1
2
3
4
5
6
7 import time
8
9
10
11 __rhnexport__ = [
12 'disable',
13 ]
14
15 -def disable(messageText, cache_only=None):
16 """We have been told that we should disable the systemid"""
17 if cache_only:
18 return (0, "no-ops for caching", {})
19
20 disableFilePath = "/etc/sysconfig/rhn/disable"
21
22 fd = open(disableFilePath, "w")
23 fd.write("Disable lock created on %s. RHN Server Message:\n\n%s\n" % (
24 time.ctime(time.time()), messageText))
25 fd.close()
26
27
28 return(0, "systemId disable lock file has been writen", {})
29