Exemple #1
0
    def __init__(self,
                 context,
                 name='remove',
                 description=DESC_REMOVE,
                 method=None,
                 type_id=None,
                 **kwargs):
        """
        :param context: client context
        :type  context: pulp.client.extensions.core.ClientContext
        :param name: The name of the command
        :type name: str
        :param description: the textual discription that will be displayed in the shell
        :type description: str
        :param method: method that will be fun when the command is invoked
        :type  method: function
        :param type_id: The type of units that this remove command supports
        :type type_id: str
        """

        # Handle odd constructor in UnitAssociationCriteriaCommand
        kwargs['name'] = name
        kwargs['description'] = description

        # We're not searching, we're using it to specify units
        kwargs['include_search'] = False

        method = method or self.run

        PollingCommand.__init__(self, name, description, method, context)
        UnitAssociationCriteriaCommand.__init__(self, method, **kwargs)

        self.type_id = type_id
        self.max_units_displayed = DISPLAY_UNITS_DEFAULT_MAXIMUM
Exemple #2
0
    def __init__(self, context, name='remove', description=DESC_REMOVE, method=None,
                 type_id=None, **kwargs):
        """
        :param context: client context
        :type  context: pulp.client.extensions.core.ClientContext
        :param name: The name of the command
        :type name: str
        :param description: the textual discription that will be displayed in the shell
        :type description: str
        :param method: method that will be fun when the command is invoked
        :type  method: function
        :param type_id: The type of units that this remove command supports
        :type type_id: str
        """

        # Handle odd constructor in UnitAssociationCriteriaCommand
        kwargs['name'] = name
        kwargs['description'] = description

        # We're not searching, we're using it to specify units
        kwargs['include_search'] = False

        method = method or self.run

        PollingCommand.__init__(self, name, description, method, context)
        UnitAssociationCriteriaCommand.__init__(self, method, **kwargs)

        self.type_id = type_id
        self.max_units_displayed = DISPLAY_UNITS_DEFAULT_MAXIMUM
Exemple #3
0
    def __init__(self,
                 context,
                 name='copy',
                 description=DESC_COPY,
                 method=None,
                 type_id=None,
                 **kwargs):

        # Handle odd constructor in UnitAssociationCriteriaCommand
        kwargs['name'] = name
        kwargs['description'] = description

        # We're not searching, we're using it to specify units
        kwargs['include_search'] = False

        method = method or self.run

        PollingCommand.__init__(self, name, description, method, context)
        UnitAssociationCriteriaCommand.__init__(self, method, **kwargs)

        self.type_id = type_id
        self.context = context
        self.prompt = context.prompt

        self.add_option(OPTION_FROM_REPO)
        self.add_option(OPTION_TO_REPO)
Exemple #4
0
    def __init__(self, context, name='remove', description=DESC_REMOVE, method=None, type_id=None, **kwargs):

        # Handle odd constructor in UnitAssociationCriteriaCommand
        kwargs['name'] = name
        kwargs['description'] = description

        # We're not searching, we're using it to specify units
        kwargs['include_search'] = False

        method = method or self.run

        PollingCommand.__init__(self, name, description, method, context)
        UnitAssociationCriteriaCommand.__init__(self, method, **kwargs)

        self.type_id = type_id
Exemple #5
0
    def __init__(self, context, name="copy", description=DESC_COPY, method=None, type_id=None, **kwargs):

        # Handle odd constructor in UnitAssociationCriteriaCommand
        kwargs["name"] = name
        kwargs["description"] = description

        # We're not searching, we're using it to specify units
        kwargs["include_search"] = False

        method = method or self.run

        PollingCommand.__init__(self, name, description, method, context)
        UnitAssociationCriteriaCommand.__init__(self, method, **kwargs)

        self.type_id = type_id
        self.context = context
        self.prompt = context.prompt

        self.add_option(OPTION_FROM_REPO)
        self.add_option(OPTION_TO_REPO)
Exemple #6
0
    def __init__(self,
                 context,
                 name='remove',
                 description=DESC_REMOVE,
                 method=None,
                 type_id=None,
                 **kwargs):

        # Handle odd constructor in UnitAssociationCriteriaCommand
        kwargs['name'] = name
        kwargs['description'] = description

        # We're not searching, we're using it to specify units
        kwargs['include_search'] = False

        method = method or self.run

        PollingCommand.__init__(self, name, description, method, context)
        UnitAssociationCriteriaCommand.__init__(self, method, **kwargs)

        self.type_id = type_id
Exemple #7
0
 def setUp(self):
     self.command = UnitAssociationCriteriaCommand(mock.MagicMock())