Пример #1
0
 def install(self, id, units, options={}):
     """
     Install content on a consumer.
     @param id: A consumer id.
     @type id: str
     @param units: A list of content units to be installed.
     @type units: list of:
         { type_id:<str>, unit_key:<dict> }
     @param options: Install options; based on unit type.
     @type options: dict
     """
     collection = Consumer.get_collection()
     consumer = collection.find_one({'id': id})
     if consumer is None:
         raise MissingResource(id)
     agent = PulpAgent(consumer)
     agent.install_units(units, options)