- (re)install any GPG signing keys before running yum
authorMark Huang <mlhuang@cs.princeton.edu>
Tue, 9 May 2006 16:43:04 +0000 (16:43 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Tue, 9 May 2006 16:43:04 +0000 (16:43 +0000)
NodeUpdate.py

index 41d5880..f863403 100644 (file)
@@ -65,6 +65,8 @@ YUM_PATH = "/usr/bin/yum"
 
 RPM_PATH = "/bin/rpm"
 
+RPM_GPG_PATH = "/etc/pki/rpm-gpg"
+
 
 # location of file containing http/https proxy info, if needed
 PROXY_FILE = '/etc/planetlab/http_proxy'
@@ -154,6 +156,14 @@ class NodeUpdate:
             return 0
 
 
+    def InstallKeys( self ):
+        Message( "\nRemoving any existing GPG signing keys from the RPM database" )
+        os.system( "%s --allmatches -e gpg-pubkey" % RPM_PATH )
+
+        Message( "\nInstalling all GPG signing keys in %s" % RPM_GPG_PATH )
+        os.system( "%s --import %s/*" % (RPM_PATH, RPM_GPG_PATH) )
+
+
     def ClearRebootFlag( self ):
         os.system( "/bin/rm -rf %s" % REBOOT_FLAG )
 
@@ -278,6 +288,7 @@ if __name__ == "__main__":
         Error( "Unable to initialize." )
     else:
         nodeupdate.RemoveRPMS()
+        nodeupdate.InstallKeys()
         nodeupdate.CheckForUpdates()
         Message( "\nUpdate complete." )