Ejemplo n.º 1
0
 def initgpgdir(self, gpgdir):
     if not os.path.exists(gpgdir):
         # initially we trust all keys which are in the RPM DB.
         # If gpgdir does not exist, we create the keyring
         # with all keys from the RPM DB
         makedirs(gpgdir)
         ts = initReadOnlyTransaction("/")
         for hdr in ts.dbMatch('name', 'gpg-pubkey'):
             if hdr['description'] != "":
                 yum.misc.import_key_to_pubring(hdr['description'], hdr['version'], gpgdir=gpgdir)
Ejemplo n.º 2
0
 def initgpgdir(self, gpgdir):
     if not os.path.exists(gpgdir):
         # initially we trust all keys which are in the RPM DB.
         # If gpgdir does not exist, we create the keyring
         # with all keys from the RPM DB
         makedirs(gpgdir)
         ts = initReadOnlyTransaction("/")
         for hdr in ts.dbMatch('name', 'gpg-pubkey'):
             if hdr['description'] != "":
                 yum.misc.import_key_to_pubring(hdr['description'],
                                                hdr['version'],
                                                gpgdir=gpgdir)
Ejemplo n.º 3
0
    def test_with_real_packages(self):
        current_dir = os.path.dirname(__file__)
        paths = glob.glob(os.path.join(
            current_dir,
            '../../data/repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/*.rpm'
        ))
        ts = transaction.initReadOnlyTransaction()

        for path in paths:
            fake_unit = {'_storage_path': path}
            self.module._migrate_unit(fake_unit, ts, self.mock_collection)
            saved_unit = self.mock_collection.save.call_args[0][0]
            self.verify_saved_unit(saved_unit)
Ejemplo n.º 4
0
    def test_with_real_packages(self):
        current_dir = os.path.dirname(__file__)
        paths = glob.glob(
            os.path.join(
                current_dir,
                '../../data/repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/*.rpm'
            ))
        ts = transaction.initReadOnlyTransaction()

        for path in paths:
            fake_unit = {'_storage_path': path}
            self.module._migrate_unit(fake_unit, ts, self.mock_collection)
            saved_unit = self.mock_collection.save.call_args[0][0]
            self.verify_saved_unit(saved_unit)
Ejemplo n.º 5
0
 def readOnlyTS(self):
     #  Should probably be able to "fake" this, so we can provide different
     # get_running_kernel_pkgtup(). Bah.
     return initReadOnlyTransaction("/")
Ejemplo n.º 6
0
 def readOnlyTS(self):
     #  Should probably be able to "fake" this, so we can provide different
     # get_running_kernel_pkgtup(). Bah.
     return initReadOnlyTransaction("/")
Ejemplo n.º 7
0
 def readOnlyTS(self):
     if not self.ts:
         self.ts = initReadOnlyTransaction(root=self.root)
     if not self.ts.open:
         self.ts = initReadOnlyTransaction(root=self.root)
     return self.ts