示例#1
0
 def unregistered(self):
     """
     Notification that the consumer has been unregistered.
     Registration artifacts are cleaned up.
     @return: The RMI request serial number.
     @rtype: str
     """
     agent = Agent(self.context.uuid,
                   url=self.context.url,
                   secret=self.context.secret,
                   async=True)
     consumer = agent.Consumer()
     return consumer.unregistered()
示例#2
0
文件: pulpagent.py 项目: beav/pulp
 def unregistered(context):
     """
     Notification that the consumer has been unregistered.
     Registration artifacts are cleaned up.
     :param context: The call context.
     :type context: pulp.server.agent.context.Context
     """
     agent = Agent(context.url,
                   context.route,
                   secret=context.secret,
                   authenticator=context.authenticator,
                   wait=0)
     consumer = agent.Consumer()
     consumer.unregistered()
示例#3
0
文件: pulpagent.py 项目: beav/pulp
 def unbind(context, bindings, options):
     """
     Unbind a consumer from the specified repository.
     :param context: The call context.
     :type context: pulp.server.agent.context.Context
     :param bindings: A list of bindings to be removed.
       Each binding is: {type_id:<str>, repo_id:<str>}
     :type bindings: list
     :param options: Unbind options.
     :type options: dict
     """
     agent = Agent(context.url,
                   context.route,
                   secret=context.secret,
                   authenticator=context.authenticator,
                   reply=context.reply_queue,
                   data=context.details)
     consumer = agent.Consumer()
     consumer.unbind(bindings, options)
示例#4
0
 def unregister(context):
     """
     Notification that the consumer has been unregistered.
     Registration artifacts are cleaned up.
     :param context: The call context.
     :type context: pulp.server.agent.context.Context
     """
     with context:
         agent = Agent(context.url,
                       context.address,
                       secret=context.secret,
                       authenticator=context.authenticator,
                       wait=0)
         consumer = agent.Consumer()
         try:
             consumer.unregister()
         except NotFound:
             # cover the case where cleanup may find that the queue
             # has already been deleted
             pass
示例#5
0
 def unbind(self, bindings, options):
     """
     Unbind a consumer from the specified repository.
     @param bindings: A list of bindings to be removed.
       Each binding is: {type_id:<str>, repo_id:<str>}
     @type bindings: list
     @param options: Unbind options.
     @type options: dict
     @return: The RMI request serial number.
     @rtype: str
     """
     agent = Agent(self.context.uuid,
                   url=self.context.url,
                   timeout=self.context.get_timeout('unbind_timeout'),
                   secret=self.context.secret,
                   ctag=self.context.ctag,
                   watchdog=self.context.watchdog,
                   any=self.context.call_request_id)
     consumer = agent.Consumer()
     return consumer.unbind(bindings, options)
示例#6
0
文件: pulpagent.py 项目: beav/pulp
 def bind(context, bindings, options):
     """
     Bind a consumer to the specified repository.
     :param context: The call context.
     :type context: pulp.server.agent.context.Context
     :param bindings: A list of bindings to add/update.
       Each binding is: {type_id:<str>, repo_id:<str>, details:<dict>}
         The 'details' are at the discretion of the distributor.
     :type bindings: list
     :param options: Bind options.
     :type options: dict
     """
     agent = Agent(context.url,
                   context.route,
                   secret=context.secret,
                   authenticator=context.authenticator,
                   reply=context.reply_queue,
                   data=context.details)
     consumer = agent.Consumer()
     consumer.bind(bindings, options)
示例#7
0
 def bind(self, bindings, options):
     """
     Bind a consumer to the specified repository.
     @param bindings: A list of bindings to add/update.
       Each binding is: {type_id:<str>, repo_id:<str>, details:<dict>}
         The 'details' are at the discretion of the distributor.
     @type bindings: list
     @param options: Bind options.
     @type options: dict
     @return: The RMI request serial number.
     @rtype: str
     """
     agent = Agent(self.context.uuid,
                   url=self.context.url,
                   timeout=self.context.get_timeout('bind_timeout'),
                   secret=self.context.secret,
                   ctag=self.context.ctag,
                   watchdog=self.context.watchdog,
                   any=self.context.call_request_id)
     consumer = agent.Consumer()
     return consumer.bind(bindings, options)