コード例 #1
0
    def _load_context(self):
        """ Set the context of the execution.

        It should be called only from the plugin manager once
        it has the context loaded.
        """
        log.debug("Loading context for plugin execution")
        self._context = ContextLoader(self._config_overrides()).load()
コード例 #2
0
 def list(self, args):
     """ List physical machines from abiquo """
     context = ContextLoader().load()
     try:
         admin = context.getAdministrationService()
         machines = admin.listMachines()
         pprint_machines(machines)
     except (AbiquoException, AuthorizationException), ex:
         print "Error %s" % ex.getMessage()