Exemple #1
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # A list of verbose error strings
        self.verbose_errors = []

        # Get a DBus payload to use.
        self._payload_proxy = get_payload(self.type)

        self.tx_id = None
        self._install_tree_metadata = None

        self._dnf_manager = DNFManager()
        self._updates_enabled = True

        # Configure the DNF logging.
        configure_dnf_logging()

        # FIXME: Don't call this method before set_from_opts.
        # This will create a default source if there is none.
        self._configure()

        # Protect access to _base.repos to ensure that the dictionary is not
        # modified while another thread is attempting to iterate over it. The
        # lock only needs to be held during operations that change the number
        # of repos or that iterate over the repos.
        self._repos_lock = threading.RLock()

        # save repomd metadata
        self._repoMD_list = []
    def get_payload_test(self, proxy_getter):
        """Test the get_payload function."""
        payloads_proxy = PAYLOADS.get_proxy()
        payloads_proxy.ActivePayload = "/my/path1"
        payloads_proxy.CreatePayload.return_value = "/my/path2"

        payload_proxy_1 = PAYLOADS.get_proxy("/my/path1")
        payload_proxy_1.Type = PAYLOAD_TYPE_LIVE_OS

        payload_proxy_2 = PAYLOADS.get_proxy("/my/path2")
        payload_proxy_2.Type = PAYLOAD_TYPE_DNF

        # Get the active payload.
        self.assertEqual(get_payload(PAYLOAD_TYPE_LIVE_OS), payload_proxy_1)
        self.assertEqual(get_payload(PAYLOAD_TYPE_LIVE_OS), payload_proxy_1)
        payloads_proxy.ActivatePayload.assert_not_called()

        # Or create a new one.
        self.assertEqual(get_payload(PAYLOAD_TYPE_DNF), payload_proxy_2)
        payloads_proxy.ActivatePayload.assert_called_once_with("/my/path2")
Exemple #3
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # A list of verbose error strings
        self.verbose_errors = []

        # Get a DBus payload to use.
        self._payload_proxy = get_payload(self.type)

        self.tx_id = None

        self._dnf_manager = DNFManager()
        self._updates_enabled = True

        # Configure the DNF logging.
        configure_dnf_logging()

        # FIXME: Don't call this method before set_from_opts.
        # This will create a default source if there is none.
        self._configure()
Exemple #4
0
    def __init__(self, data):
        super().__init__()
        self.data = data

        # A list of verbose error strings
        self.verbose_errors = []

        # Get a DBus payload to use.
        self._payload_proxy = get_payload(self.type)

        self.tx_id = None

        self._dnf_manager = DNFManager()

        # List of internal mount points.
        self._mount_points = []

        # Configure the DNF logging.
        configure_dnf_logging()
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._payload_proxy = get_payload(self.type)
Exemple #6
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._payload_proxy = get_payload(self.type)
     self._remoteOptions = None
     self._internal_mounts = []
Exemple #7
0
 def _create_payload_proxy(self):
     """Create a DBus proxy of the requested payload."""
     return get_payload(self.type)