Package actions :: Module systemid
[hide private]
[frames] | no frames]

Source Code for Module actions.systemid

 1  #!/usr/bin/python2 
 2  # 
 3  # Copyright (c) 1999--2018 Red Hat, Inc.  Distributed under GPLv2. 
 4  # 
 5  # Author: Adrian Likins <alikins@redhat.com> 
 6   
 7  import time 
 8   
 9   
10  # mark this module as acceptable 
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 # open and shut off 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 # done if we survived this long 28 return(0, "systemId disable lock file has been writen", {})
29