@@ -18,7 +18,6 @@ PATCH_ALREADY_APPLIED = 'PATCH_ALREADY_APPLIED'
1818PATCH_APPLY_FAILED = 'PATCH_APPLY_FAILED'
1919OTHER_OPERATION_IN_PROGRESS = 'OTHER_OPERATION_IN_PROGRESS'
2020PATCH_PRECHECK_FAILED_UNKNOWN_ERROR = 'PATCH_PRECHECK_FAILED_UNKNOWN_ERROR'
21- FIST_FILE = '/tmp/fist_allowed_unsigned_updates'
2221
2322
2423class ApplyFailure (Exception ):
@@ -36,10 +35,10 @@ def failure_message(code, params):
3635 return xmlrpclib .dumps ((rpcparams , ), '' , True )
3736
3837
39- def execute_apply (session , update_package , yum_conf_file , nogpgcheck ):
38+ def execute_apply (session , update_package , yum_conf_file ):
4039 FNULL = open (os .devnull , 'w' )
4140 retcode = subprocess .call ('yum -c ' + yum_conf_file + ' install -y ' +
42- nogpgcheck + update_package , shell = True , stdout = FNULL , stderr = FNULL )
41+ update_package , shell = True , stdout = FNULL , stderr = FNULL )
4342 if retcode != 0 :
4443 raise ApplyFailure (
4544 'Failed to install update_package (%r).' % update_package )
@@ -85,11 +84,6 @@ if __name__ == '__main__':
8584 failure_message (PATCH_PRECHECK_FAILED_UNKNOWN_ERROR , ['%s' % str (e )]))
8685 sys .exit (0 )
8786
88- allow_unsigned = False
89- if os .path .isfile (FIST_FILE ):
90- allow_unsigned = update_uuid in open (FIST_FILE , 'rb' ).read ().split ()
91- nogpgcheck = ' --nogpgcheck ' if allow_unsigned else ' '
92-
9387 # Apply the update.
9488 try :
9589 yum_conf = session .xenapi .pool_update .attach (update )
@@ -103,7 +97,7 @@ if __name__ == '__main__':
10397 with open (yum_conf_file , "w+" ) as file :
10498 file .write ("{0}" .format (yum_conf ))
10599
106- execute_apply (session , update_package , yum_conf_file , nogpgcheck )
100+ execute_apply (session , update_package , yum_conf_file )
107101
108102 session .xenapi .pool_update .resync_host (host )
109103 print (success_message ())
0 commit comments