Example #1
0
 def process_main(self, item=None):
     """
     Add/update the remote summary information in the
     repository scratchpad.
     """
     try:
         lib_repository = lib.Repository(self.parent.storage_dir)
         remote = lib.Remote(self.parent.repo_id, lib_repository)
         refs = [r.dict() for r in remote.list_refs()]
     except lib.LibError, le:
         pe = PulpCodedException(errors.OST0005, reason=str(le))
         raise pe
Example #2
0
 def process_main(self, item=None):
     """
     Clean up after import:
      - Delete the remote used for the pull.
     """
     path = self.parent.storage_dir
     remote_id = self.parent.repo_id
     try:
         repository = lib.Repository(path)
         remote = lib.Remote(remote_id, repository)
         remote.delete()
     except lib.LibError, le:
         pe = PulpCodedException(errors.OST0003, id=remote_id, reason=str(le))
         raise pe
Example #3
0
 def add(self):
     """
     Add (or replace) this remote to the repository.
     """
     path, key_ids = self.gpg_keys
     impl = lib.Remote(self.remote_id, self.repository)
     impl.url = self.url
     impl.ssl_key_path = self.ssl_key_path
     impl.ssl_cert_path = self.ssl_cert_path
     impl.ssl_ca_path = self.ssl_ca_path
     impl.ssl_validation = self.ssl_validation
     impl.gpg_validation = len(key_ids) > 0
     impl.proxy_url = self.proxy_url
     impl.update()
     if key_ids:
         impl.import_key(path, key_ids)
Example #4
0
 def process_main(self, item=None):
     """
     Add/update the remote summary information in the
     repository scratchpad.
     """
     repository = self.get_repo().repo_obj
     lib_repository = lib.Repository(self.parent.storage_dir)
     remote = lib.Remote(self.parent.repo_id, lib_repository)
     refs = [r.dict() for r in remote.list_refs()]
     map(self.convert_metadata_dict, refs)
     repository.scratchpad.update({
         constants.REMOTE: {
             constants.SUMMARY: refs
         }
     })
     repository.save()
Example #5
0
 def process_main(self, item=None):
     """
     Add/update the remote summary information in the
     repository scratchpad.
     """
     try:
         lib_repository = lib.Repository(self.parent.storage_dir)
         remote = lib.Remote(self.parent.repo_id, lib_repository)
         refs = [r.dict() for r in remote.list_refs()]
     except lib.LibError as le:
         pe = PulpCodedException(errors.OST0005, reason=str(le))
         raise pe
     repository = self.get_repo().repo_obj
     map(self.clean_metadata, refs)
     repository.scratchpad.update(
         {constants.REMOTE: {
             constants.SUMMARY: refs
         }})
     repository.save()