Changeset 4699


Ignore:
Timestamp:
May 11, 2017, 11:42:15 AM (2 years ago)
Author:
hectorgh
Message:

making sure cronfile exists before deleting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-zero-shutdown-client/trunk/fuentes/lliurex-zero-shutdown-client.install-files/usr/share/n4d/python-plugins/ShutdownerClient.py

    r498 r4699  
    2525        def noshutdown_cron(self,aux_cronfile=cronfile):
    2626                try:
    27                         os.system('mv %s /tmp/' %(aux_cronfile))
    28                        
    29                         COMMENT_END = "You have deactivated shutdown file in: %s (moved to /tmp)" %(aux_cronfile)
     27                        COMMENT_END = "No lliurexshutdown file configured."
     28                        if os.path.exists(aux_cronfile):
     29                                os.remove(aux_cronfile)
     30                                COMMENT_END = "You have deactivated shutdown file"
    3031                        return [True,str(COMMENT_END)]
    3132       
Note: See TracChangeset for help on using the changeset viewer.