Beispiel #1
0
 def processConfigOptions(self, cfg, cfgMap, argSet):
     AbstractCommand.processConfigOptions(self, cfg, cfgMap, argSet)
     cfg.logFile = None
     self.cfg = cfg
     if cfg.repositoryDB:
         self.netRepos = netserver.NetworkRepositoryServer(cfg, 'localhost')
     else:
         self.netRepos = None
Beispiel #2
0
 def processConfigOptions(self, cfg, *args, **kwargs):
     AbstractCommand.processConfigOptions(self, cfg, *args, **kwargs)
     self.cfg = cfg
     if not self.cfg.authPass and os.getuid() != 0:
         sys.exit("error: Can't authenticate. "
                 "This script must be run as root.")
     api = robj.connect("https://%s:%s@localhost/api" %
             (self.cfg.authUser, self.cfg.authPass))
     for v in self._collection(api.api_versions):
         if v.name == 'v1':
             self.api = v
             break