bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def all_schedules(self): method = "/repositories/schedules/" return self.conn.request_get(method) | def all_schedules(self): method = "/repositories/schedules/" return self.conn.request_get(method) | 453,900 |
def sync_status(self, status_path): return self.conn.request_get(status_path) | def sync_status(self, status_path): return self.conn.request_get(status_path) | 453,901 |
def add_errata(self, id, errataids): erratainfo = {'repoid' : id, 'errataid' : errataids} method = "/repositories/%s/add_errata/" % id return self.conn.request_post(method, params=erratainfo) | def add_errata(self, id, errataids): erratainfo = {'repoid' : id, 'errataid' : errataids} method = "/repositories/%s/add_errata/" % id return self.conn.request_post(method, params=erratainfo) | 453,902 |
def delete_errata(self, id, errataids): erratainfo = {'repoid' : id, 'errataid' : errataids} method = "/repositories/%s/delete_errata/" % id return self.conn.request_post(method, params=erratainfo) | def delete_errata(self, id, errataids): erratainfo = {'repoid' : id, 'errataid' : errataids} method = "/repositories/%s/delete_errata/" % id return self.conn.request_post(method, params=erratainfo) | 453,903 |
def errata(self, id, types=[]): erratainfo = {'repoid' : id, 'types' : types} method = "/repositories/%s/list_errata/" % id return self.conn.request_post(method, params=erratainfo) | def errata(self, id, types=[]): erratainfo = {'repoid' : id, 'types' : types} method = "/repositories/%s/list_errata/" % id return self.conn.request_post(method, params=erratainfo) | 453,904 |
def create(self, id, description): consumerdata = {"id" : id, "description" : description} method = "/consumers/" return self.conn.request_put(method, params=consumerdata) | def create(self, id, description): consumerdata = {"id" : id, "description" : description} method = "/consumers/" return self.conn.request_put(method, params=consumerdata) | 453,905 |
def unbind(self, id, repoid): method = "/consumers/%s/unbind/" % id return self.conn.request_post(method, params=repoid) | def unbind(self, id, repoid): method = "/consumers/%s/unbind/" % id return self.conn.request_post(method, params=repoid) | 453,906 |
def installpackages(self, id, packagenames): method = "/consumers/%s/installpackages/" % id body = dict(packagenames=packagenames) return self.conn.request_post(method, params=body) | def installpackages(self, id, packagenames): method = "/consumers/%s/installpackages/" % id body = dict(packagenames=packagenames) return self.conn.request_post(method, params=body) | 453,907 |
def installpackagegroups(self, id, packageids): method = "/consumers/%s/installpackagegroups/" % id body = dict(packageids=packageids) return self.conn.request_post(method, params=body) | def installpackagegroups(self, id, packageids): method = "/consumers/%s/installpackagegroups/" % id body = dict(packageids=packageids) return self.conn.request_post(method, params=body) | 453,908 |
def errata(self, id, types=None): method = "/consumers/%s/listerrata/" % id body = dict(types=types) return self.conn.request_post(method, params=body) | def errata(self, id, types=None): method = "/consumers/%s/listerrata/" % id body = dict(types=types) return self.conn.request_post(method, params=body) | 453,909 |
def installerrata(self, id, errataids, types=[]): erratainfo = {'consumerid' : id, 'errataids' : errataids, 'types' : types} method = "/consumers/%s/installerrata/" % id return self.conn.request_post(method, params=erratainfo) | def installerrata(self, id, errataids, types=[]): erratainfo = {'consumerid' : id, 'errataids' : errataids, 'types' : types} method = "/consumers/%s/installerrata/" % id return self.conn.request_post(method, params=erratainfo) | 453,910 |
def create(self, id, description, consumerids = []): consumergroup_data = {"id" : id, "description" : description, "consumerids" : consumerids} method = "/consumergroups/" return self.conn.request_put(method, params=consumergroup_data) | def create(self, id, description, consumerids=[]): consumergroup_data = {"id" : id, "description" : description, "consumerids" : consumerids} method = "/consumergroups/" return self.conn.request_put(method, params=consumergroup_data) | 453,911 |
def unbind(self, id, repoid): method = "/consumergroups/%s/unbind/" % id return self.conn.request_post(method, params=repoid) | def unbind(self, id, repoid): method = "/consumergroups/%s/unbind/" % id return self.conn.request_post(method, params=repoid) | 453,912 |
def create(self, name, epoch, version, release, arch, description, checksum_type, checksum, filename): method = "/packages/" repodata = {"name" : name, "epoch" : epoch, "version" : version, "release" : release, "arch" : arch, "description" : description, "checksum_type" : checksum_type, "checksum": checksum, "filenam... | def create(self, name, epoch, version, release, arch, description, checksum_type, checksum, filename): method = "/packages/" repodata = {"name" : name, "epoch" : epoch, "version" : version, "release" : release, "arch" : arch, "description" : description, "checksum_type" : checksum_type, "checksum": checksum, "filenam... | 453,913 |
def create(self, name, epoch, version, release, arch, description, checksum_type, checksum, filename): method = "/packages/" repodata = {"name" : name, "epoch" : epoch, "version" : version, "release" : release, "arch" : arch, "description" : description, "checksum_type" : checksum_type, "checksum": checksum, "filenam... | def create(self, name, epoch, version, release, arch, description, checksum_type, checksum, filename): method = "/packages/" repodata = {"name" : name, "epoch" : epoch, "version" : version, "release" : release, "arch" : arch, "description" : description, "checksum_type" : checksum_type, "checksum": checksum, "filenam... | 453,914 |
def errata(self, id=None, title=None, description=None, version=None, release=None, type=None, status=None, updated=None, issued=None, pushcount=None, from_str=None, reboot_suggested=None): pass | def errata(self, id=None, title=None, description=None, version=None, release=None, type=None, status=None, updated=None, issued=None, pushcount=None, from_str=None, reboot_suggested=None): pass | 453,915 |
def errata(self, id=None, title=None, description=None, version=None, release=None, type=None, status=None, updated=None, issued=None, pushcount=None, from_str=None, reboot_suggested=None): pass | def errata(self, id=None, title=None, description=None, version=None, release=None, type=None, status=None, updated=None, issued=None, pushcount=None, from_str=None, reboot_suggested=None): pass | 453,916 |
def run(self): id = self.get_required_option('id') files = self.args if not files: system_exit(os.EX_USAGE, _("need to provide at least one file to perform upload")) dir = self.opts.dir if dir: files += utils.processDirectory(dir, "rpm") uploadinfo = {} uploadinfo['repo'] = id for frpm in files: try: pkginfo = utils.pr... | def run(self): id = self.get_required_option('id') files = self.args if not files: system_exit(os.EX_USAGE, _("need to provide at least one file to perform upload")) uploadinfo = {} uploadinfo['repo'] = id for frpm in files: try: pkginfo = utils.processRPM(frpm) except FileError, e: print >> sys.stderr, _('error: %s') ... | 453,917 |
def main(): ed = EventDispatcher() ed.start() p = EventProducer() for n in range(0, 1): d = dict( id='repo%d' % n, name='Repository%d' % n, arch='noarch',) p.send('bogus', 'bogus') #p.send('user', 'user without subject') #p.send('user.hello', 'user.%d' % n) #p.send('user.created', '{%d} user.created' % n) #p.send('user... | def main(): p = EventProducer() for n in range(0, 1): d = dict( id='repo%d' % n, name='Repository%d' % n, arch='noarch',) p.send('bogus', 'bogus') #p.send('user', 'user without subject') #p.send('user.hello', 'user.%d' % n) #p.send('user.created', '{%d} user.created' % n) #p.send('user.updated', '{%d} user.updated' %... | 453,918 |
def create(self, id, description): """ Create a new Consumer object and return it """ consumer = self.consumer(id) if(consumer): raise PulpException("A Consumer with id %s already exists" % id) c = model.Consumer(id, description) self.insert(c) return c | def create(self, id, description): """ Create a new Consumer object and return it """ consumer = self.consumer(id) if(consumer): raise PulpException("A Consumer with id %s already exists" % id) c = model.Consumer(id, description) self.insert(c) return c | 453,919 |
def setup_connections(self): # first take into account the new credentials Credentials.setuser(self.opts.username, self.opts.password) self.authconn = UserConnection() | def setup_connections(self): # first take into account the new credentials username = self.opts.username password = self.opts.password if username and password: Credentials.setuser(username, password) self.authconn = UserConnection() | 453,920 |
def __init__(self): self.rapi = productApi() | def __init__(self): self.rapi = productApi() | 453,921 |
def set_cert_key_files(cert_file, key_file): global _cert_file, key_file assert None not in (cert_file, key_file) _cert_file = cert_file _key_file = key_file | def set_cert_key_files(cert_file, key_file): global _cert_file, _key_file assert None not in (cert_file, key_file) _cert_file = cert_file _key_file = key_file | 453,922 |
def test_super_users(self): role = _role_api.role(authorization.super_user_role) self.assertFalse(role is None) | def test_super_users(self): role = self.role_api.role(authorization.super_user_role) self.assertFalse(role is None) | 453,923 |
def test_super_users_grant(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.grant_permission_to_role, (s, authorization.super_user_role, [n])) | def test_super_users_grant(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.grant_permission_to_role, (s, authorization.super_user_role, [n])) | 453,924 |
def test_super_users_revoke(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.revoke_permission_from_role, (s, authorization.super_user_role, [n])) | def test_super_users_revoke(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.revoke_permission_from_role, (s, authorization.super_user_role, [n])) | 453,925 |
def test_super_users_remove(self): u = self._create_user() authorization.add_user_to_role(authorization.super_user_role, u['name']) self.assertRaises(authorization.PulpAuthorizationError, authorization.remove_user_from_role, (authorization.super_user_role, u['name'])) | def test_super_users_remove(self): u = self._create_user() authorization.add_user_to_role(authorization.super_user_role, u['name']) self.assertRaises(authorization.PulpAuthorizationError, authorization.remove_user_from_role, (authorization.super_user_role, u['name'])) | 453,926 |
def test_consumer_users(self): role = _role_api.role(authorization.consumer_users_role) self.assertFalse(role is None) | def test_consumer_users(self): role = self.role_api.role(authorization.consumer_users_role) self.assertFalse(role is None) | 453,927 |
def test_consumer_users_grant(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.grant_permission_to_role, (s, authorization.consumer_users_role, [n])) | def test_consumer_users_grant(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.grant_permission_to_role, (s, authorization.consumer_users_role, [n])) | 453,928 |
def test_consumer_users_revoke(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.revoke_permission_from_role, (s, authorization.consumer_users_role, [n])) | def test_consumer_users_revoke(self): s = self._create_resource() n = authorization.operation_to_name(authorization.READ) self.assertRaises(authorization.PulpAuthorizationError, authorization.revoke_permission_from_role, (s, authorization.consumer_users_role, [n])) | 453,929 |
def _get_lifetime(): """ Get the configured auditing lifeteime as a datetime.timedelta instance. @return: dateteime.timedelta instance """ days = config.config.getint('auditing', 'lifetime') return datetime.timedelta(days=days) | def _get_lifetime(): """ Get the configured auditing lifetime as a datetime.timedelta instance. @return: dateteime.timedelta instance """ days = config.config.getint('auditing', 'lifetime') return datetime.timedelta(days=days) | 453,930 |
def test_repo_gpgkeys(self): id = 'fedora' relativepath = 'f11/i386' feed = 'yum:http://abc.com/%s' % relativepath repo = self.rapi.create(id, 'Fedora', 'noarch', feed=feed) keyA = ('keyA', 'MY KEY (A) CONTENT') keyB = ('keyB', 'MY KEY (B) CONTENT') keylist = [keyA, keyB] ks = KeyStore(relativepath) ks.clean() # multip... | def test_repo_gpgkeys(self): id = 'fedora' relativepath = 'f11/i386' feed = 'yum:http://abc.com/%s' % relativepath repo = self.rapi.create(id, 'Fedora', 'noarch', feed=feed) keyA = ('keyA', 'MY KEY (A) CONTENT') keyB = ('keyB', 'MY KEY (B) CONTENT') keylist = [keyA, keyB] ks = KeyStore(relativepath) ks.clean() # multip... | 453,931 |
def setup_parser(self): self.parser.add_option('--username', dest='username', help=_('pulp account username')) self.parser.add_option('--password', dest='password', help=_('pulp account password')) | def setup_parser(self): self.parser.add_option('--username', dest='username', help=_('pulp account username')) self.parser.add_option('--password', dest='password', help=_('pulp account password')) | 453,932 |
def create_role(self, name): desc = 'test desc for role' # Todo: move these to an enum action_type = ['READ', 'WRITE'] # Todo: move this to an enum resource_type = 'REPO' role = self.rolapi.create(name, desc, action_type, resource_type) return role | def create_role(self, name): desc = 'test desc for role' # Todo: move these to an enum action_type = ['READ', 'WRITE'] # Todo: move this to an enum resource_type = 'REPO' role = self.rolapi.create(name, desc, action_type, resource_type) return role | 453,933 |
def create_role(self, name): desc = 'test desc for role' # Todo: move these to an enum action_type = ['READ', 'WRITE'] # Todo: move this to an enum resource_type = 'REPO' role = self.rolapi.create(name, desc, action_type, resource_type) return role | def create_role(self, name): desc = 'test desc for role' # Todo: move these to an enum action_type = ['READ', 'WRITE'] # Todo: move this to an enum resource_type = 'REPO' role = self.rolapi.create(name, desc, action_type, resource_type) return role | 453,934 |
def test_role_within_role(self): role1 = self.create_role('root-role') role2 = self.create_role('child-role') role1['children'] = [role2] role2['parent'] = role1 self.roleapi.update(role1) self.roleapi.update(role2) updated_root = self.roleapi.role('root-role') self.assertNotNone(updated_root['children']) updated_chi... | def test_role_within_role(self): role1 = self.create_role('root-role') role2 = self.create_role('child-role') role1['children'] = [role2] role2['parent'] = role1 self.roleapi.update(role1) self.roleapi.update(role2) updated_root = self.roleapi.role('root-role') self.assertNotNone(updated_root['children']) updated_chi... | 453,935 |
def create(self, id, name, arch, feed, sync_schedule=None): method = "/repositories/" repodata = {"id" : id, "name" : name, "arch" : arch, "feed" : feed, "sync_schedule" : sync_schedule,} return self.conn.request_post(method, params=repodata) | def create(self, id, name, arch, feed, sync_schedule=None): method = "/repositories/" repodata = {"id" : id, "name" : name, "arch" : arch, "feed" : feed, "sync_schedule" : sync_schedule,} return self.conn.request_post(method, params=repodata) | 453,936 |
def update(self, repo): method = "/repositories/%s/" % repo['id'] return self.conn.request_post(method, params=repo) | def update(self, repo): method = "/repositories/%s/" % repo['id'] return self.conn.request_post(method, params=repo) | 453,937 |
def sync(self, repoid): method = "/repositories/%s/sync/" % repoid return self.conn.request_get(method) | def sync(self, repoid): method = "/repositories/%s/sync/" % repoid return self.conn.request_get(method) | 453,938 |
def packages(self, repoid): method = "/repositories/%s/list/" % repoid return self.conn.request_get(method) | def packages(self, repoid): method = "/repositories/%s/list/" % repoid return self.conn.request_get(method) | 453,939 |
def create(self, id, description): consumerdata = {"id" : id, "description" : description} method = "/consumers/" return self.conn.request_post(method, params=consumerdata) | def create(self, id, description): consumerdata = {"id" : id, "description" : description} method = "/consumers/" return self.conn.request_put(method, params=consumerdata) | 453,940 |
def update(self, consumer): method = "/consumers/%s/" % consumer['id'] return self.conn.request_post(method, params=consumer) | def update(self, consumer): method = "/consumers/%s/" % consumer['id'] return self.conn.request_post(method, params=consumer) | 453,941 |
def packages(self, id): method = "/consumers/%s/packages/" % str(id) return self.conn.request_get(method) | def packages(self, id): method = "/consumers/%s/packages/" % str(id) return self.conn.request_get(method) | 453,942 |
def create(self, name, epoch, version, release, arch, description, checksum_type, checksum, filename): method = "/packages/" repodata = {"name" : name, "epoch" : epoch, "version" : version, "release" : release, "arch" : arch, "description" : description, "checksum_type" : checksum_type, "checksum": checksum, "filenam... | def create(self, name, epoch, version, release, arch, description, checksum_type, checksum, filename): method = "/packages/" repodata = {"name" : name, "epoch" : epoch, "version" : version, "release" : release, "arch" : arch, "description" : description, "checksum_type" : checksum_type, "checksum": checksum, "filenam... | 453,943 |
def _list(self): (self.options, self.args) = self.parser.parse_args() try: repos = self.pconn.repositories() columns = ["id", "name", "source", "arch", "packages"] data = [ _sub_dict(repo, columns) for repo in repos] if not len(data): print _("No repos available to list") sys.exit(0) print """+-------------------------... | def _list(self): (self.options, self.args) = self.parser.parse_args() try: repos = self.pconn.repositories() columns = ["id", "name", "source", "arch", "packages"] data = [ _sub_dict(repo, columns) for repo in repos] if not len(data): print _("No repos available to list") sys.exit(0) print """+-------------------------... | 453,944 |
def _sync(self): (self.options, self.args) = self.parser.parse_args() if not self.options.label: print("repo label required. Try --help") sys.exit(0) try: status = self.pconn.sync(self.options.label) if status: packages = self.pconn.packages(self.options.label) pkg_count = _pkg_count(packages) print _(" Sync Successfu... | def _sync(self): (self.options, self.args) = self.parser.parse_args() if not self.options.label: print("repo label required. Try --help") sys.exit(0) try: status = self.pconn.sync(self.options.label) if status: packages = self.pconn.packages(self.options.label) pkg_count = len(packages) print _(" Sync Successful. Repo... | 453,945 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.label: print("repo label required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.label: print("repo label required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide... | 453,946 |
def create_repo(dir, groups=None): cmd = "createrepo --update %s" % (dir) if groups: cmd = "createrepo -g %s --update %s" % (groups, dir) status, out = commands.getstatusoutput(cmd) if status != 0: log.error("createrepo on %s failed" % dir) raise CreateRepoError(out) log.info("createrepo on %s finished" % dir) return ... | def create_repo(dir, groups=None): cmd = "createrepo -g %s --update %s" % (groups, dir) if not groups: cmd = "createrepo --update %s" % (dir) repodata_file = os.path.join(dir, "repodata", "repomd.xml") if os.path.isfile(repodata_file): log.info("Checking what metadata types are available: %s" % \ (util.get_repomd_filet... | 453,947 |
def create_repo(dir, groups=None): cmd = "createrepo --update %s" % (dir) if groups: cmd = "createrepo -g %s --update %s" % (groups, dir) status, out = commands.getstatusoutput(cmd) if status != 0: log.error("createrepo on %s failed" % dir) raise CreateRepoError(out) log.info("createrepo on %s finished" % dir) return ... | def create_repo(dir, groups=None): cmd = "createrepo --update %s" % (dir) if groups: cmd = "createrepo -g %s --update %s" % (groups, dir) status, out = commands.getstatusoutput(cmd) if status != 0: log.error("createrepo on %s failed" % dir) raise CreateRepoError(out) log.info("[%s] on %s finished" % (cmd, dir)) return... | 453,948 |
def test_repository_with_groupid(self): repo = self.rapi.create('some-id', 'some name', \ 'i386', 'yum:http://example.com/mypath', groupid="testgroup") found = self.rapi.repository('some-id') assert(found is not None) assert(found['id'] == 'some-id') assert(found['groupid'] == ["testgroup"]) | def test_repository_with_groupid(self): repo = self.rapi.create('some-id', 'some name', \ 'i386', 'yum:http://example.com/mypath', groupid=["testgroup"]) found = self.rapi.repository('some-id') assert(found is not None) assert(found['id'] == 'some-id') assert(found['groupid'] == ["testgroup"]) | 453,949 |
def __init__(self, name="cli", usage=None, shortdesc=None, description=None): self.shortdesc = shortdesc if shortdesc is not None and description is None: description = shortdesc self.debug = 0 self.parser = OptionParser(usage=usage, description=description) self._add_common_options() self.name = name self.killcount = ... | def __init__(self, name="cli", usage=None, shortdesc=None, description=None): self.shortdesc = shortdesc if shortdesc is not None and description is None: description = shortdesc self.parser = OptionParser(usage=usage, description=description) self._add_common_options() self.name = name self.killcount = 0 #GrinderLog.s... | 453,950 |
def __init__(self, name="cli", usage=None, shortdesc=None, description=None): self.shortdesc = shortdesc if shortdesc is not None and description is None: description = shortdesc self.debug = 0 self.parser = OptionParser(usage=usage, description=description) self._add_common_options() self.name = name self.killcount = ... | def__init__(self,name="cli",usage=None,shortdesc=None,description=None):self.shortdesc=shortdescifshortdescisnotNoneanddescriptionisNone:description=shortdescself.debug=0self.parser=OptionParser(usage=usage,description=description)self._add_common_options()self.name=nameself.killcount=0#GrinderLog.setup(self.debug) | 453,951 |
def _add_common_options(self): """ Add options that apply to all sub-commands. """ self.parser.add_option("--debug", dest="debug", default=0, help="debug level") | def _add_common_options(self): """ Add options that apply to all sub-commands. """ self.parser.add_option("--debug", dest="debug", default=0, help="debug level") | 453,952 |
def __init__(self): usage = "usage: %prog rhn [OPTIONS]" shortdesc = "Fetches content from a rhn source." desc = "rhn" CliDriver.__init__(self, "rhn", usage, shortdesc, desc) GrinderLog.setup(self.debug) self.rhnSync = RHNSync() | def __init__(self): usage = "usage: %prog rhn [OPTIONS]" shortdesc = "Fetches content from a rhn source." desc = "rhn" CliDriver.__init__(self, "rhn", usage, shortdesc, desc) self.rhnSync = RHNSync() | 453,953 |
def __init__(self): usage = "usage: %prog yum [OPTIONS]" shortdesc = "Fetches content from a yum repo." desc = "yum" CliDriver.__init__(self, "yum", usage, shortdesc, desc) GrinderLog.setup(self.debug) | def __init__(self): usage = "usage: %prog yum [OPTIONS]" shortdesc = "Fetches content from a yum repo." desc = "yum" CliDriver.__init__(self, "yum", usage, shortdesc, desc) GrinderLog.setup(self.debug) | 453,954 |
def _get_tasks(self): # Get the next 'n' tasks to run, where is max - currently running tasks num_tasks = self.max_running - self.__running_count return self.__storage.waiting_tasks()[:num_tasks] | def""" Get the next 'n' tasks to run, where is max - currently running tasks """ _get_tasks(self):""" Get the next 'n' tasks to run, where is max - currently running tasks """ #""" Get the next 'n' tasks to run, where is max - currently running tasks """ Get""" Get the next 'n' tasks to run, where is max - currently ru... | 453,955 |
def _cull_tasks(self): # Clean up finished task data complete_tasks = self.__storage.complete_tasks() if not complete_tasks: return now = datetime.now() for task in complete_tasks: if now - task.finish_time > self.finished_lifetime: self.__storage.remove_task(task) | def""" Clean up finished task data """ _cull_tasks(self):""" Clean up finished task data """ #""" Clean up finished task data """ Clean""" Clean up finished task data """ up""" Clean up finished task data """ finished""" Clean up finished task data """ task""" Clean up finished task data """ data""" Clean up finished t... | 453,956 |
def test_resync_removes_deleted_package(self): # Since a repo with 3 packages, simulate the repo source deleted 1 package # Re-sync ensure we delete the removed package repo_path = os.path.join(self.data_path, "repo_resync_a") r = self.rapi.create('test_resync_removes_deleted_package', 'test_name', 'x86_64', 'local:fil... | def disabled_resync_removes_deleted_package(self): # Since a repo with 3 packages, simulate the repo source deleted 1 package # Re-sync ensure we delete the removed package repo_path = os.path.join(self.data_path, "repo_resync_a") r = self.rapi.create('test_resync_removes_deleted_package', 'test_name', 'x86_64', 'loca... | 453,957 |
def check_user_pass_on_ldap(self, username, password=None): ''' verify the credentials for user on ldap server. @param username: Userid to be validated on ldap server @param password: password credentials for userid @return: user instance of the authenticated user if valid credentials were specified; None otherwise @rt... | def check_user_pass_on_ldap(self, username, password=None): ''' verify the credentials for user on ldap server. @param username: Userid to be validated on ldap server @param password: password credentials for userid @return: user instance of the authenticated user if valid credentials were specified; None otherwise @rt... | 453,958 |
def test_import_groups_data(self): repo = self.rapi.create('test_import_groups_data_id', 'test_import_groups_data_id', 'i386', 'yum:http://example.com/') # Parse existing comps.xml compspath = "./data/rhel-i386-server-5/comps.xml" compsfile = open(compspath) base = BaseSynchronizer(self.config) base.import_groups_data(... | def test_import_groups_data(self): repo = self.rapi.create('test_import_groups_data_id', 'test_import_groups_data_id', 'i386', 'yum:http://example.com/') # Parse existing comps.xml compspath = os.path.join(self.dataPath, "rhel-i386-server-5/comps.xml") compsfile = open(compspath) base = BaseSynchronizer(self.config) ba... | 453,959 |
def _create(self): (self.options, self.args) = self.parser.parse_args() if not self.options.label: print("repo label required. Try --help") sys.exit(0) if not self.options.name: self.options.name = self.options.label if not self.options.arch: self.options.arch - "noarch" if not self.options.feed: print("repo feed requi... | def _create(self): (self.options, self.args) = self.parser.parse_args() if not self.options.label: print("repo label required. Try --help") sys.exit(0) if not self.options.name: self.options.name = self.options.label if not self.options.arch: self.options.arch = "noarch" if not self.options.feed: print("repo feed requi... | 453,960 |
def __init__(self): self.cli_cores = {} for clazz in [ RepoCore, ConsumerCore]: cmd = clazz() # ignore the base class if cmd.name != "cli": self.cli_cores[cmd.name] = cmd | def __init__(self): self.cli_cores = {} for clazz in [ RepoCore, ConsumerCore]: cmd = clazz() # ignore the base class if cmd.name != "cli": self.cli_cores[cmd.name] = cmd | 453,961 |
def test_task(self): t = Task(thread_id) print 'task id: %s' % str(t.id) t.reset(args=[t.id]) t.run() time.sleep(0.0005) self.assertTrue(t.status == FINISHED) | def test_task(self): t = Task(thread_id) print 'task id: %s' % str(t.id) t.args=[t.id] t.run() time.sleep(0.0005) self.assertTrue(t.status == FINISHED) | 453,962 |
def test_multi_runs(self): t = Task(thread_id) print 'task id: %s' % str(t.id) t.reset(args=[t.id]) t.run() time.sleep(0.0005) self.assertTrue(t.status == FINISHED) t.run() time.sleep(0.0005) self.assertTrue(t.status == FINISHED) | def test_multi_runs(self): t = Task(thread_id) print 'task id: %s' % str(t.id) t.args=[t.id] t.run() time.sleep(0.0005) self.assertTrue(t.status == FINISHED) t.run() time.sleep(0.0005) self.assertTrue(t.status == FINISHED) | 453,963 |
def test_consumerwithpackage(self): c = self.capi.create('test-consumer', 'some consumer desc') c.packageids.append(package["packageid"]) for i in range(10): repo = self.rapi.create('some-id','some name', 'i386', 'yum:http://example.com') package = self.rapi.create_package(repo.id, 'test_consumerwithpackage', 'test pac... | def test_consumerwithpackage(self): c = self.capi.create('test-consumer', 'some consumer desc') repo = self.rapi.create('some-id', 'some name', 'i386', 'yum:http://example.com') for i in range(10): repo = self.rapi.create('some-id','some name', 'i386', 'yum:http://example.com') package = self.rapi.create_package(repo.i... | 453,964 |
def test_consumerwithpackage(self): c = self.capi.create('test-consumer', 'some consumer desc') c.packageids.append(package["packageid"]) for i in range(10): repo = self.rapi.create('some-id','some name', 'i386', 'yum:http://example.com') package = self.rapi.create_package(repo.id, 'test_consumerwithpackage', 'test pac... | def test_consumerwithpackage(self): c = self.capi.create('test-consumer', 'some consumer desc') c.packageids.append(package["packageid"]) for i in range(10): package = self.rapi.create_package(repo["id"], 'test_consumerwithpackage', 'test package search') repo = self.rapi.repository(repo["id"]) c.packageids.append(pack... | 453,965 |
def test_consumerwithpackage(self): c = self.capi.create('test-consumer', 'some consumer desc') c.packageids.append(package["packageid"]) for i in range(10): repo = self.rapi.create('some-id','some name', 'i386', 'yum:http://example.com') package = self.rapi.create_package(repo.id, 'test_consumerwithpackage', 'test pac... | def test_consumerwithpackage(self): c = self.capi.create('test-consumer', 'some consumer desc') c.packageids.append(package["packageid"]) for i in range(10): repo = self.rapi.create('some-id','some name', 'i386', 'yum:http://example.com') package = self.rapi.create_package(repo.id, 'test_consumerwithpackage', 'test pac... | 453,966 |
def __init__(self, max_running=4, finished_lifetime=timedelta(seconds=3600)): """ @type max_running: int @param max_running: maximum number of tasks to run simultaneously None means indefinitely @type finished_lifetime: datetime.timedelta instance @param finished_lifetime: length of time to keep finished tasks @return:... | def __init__(self, max_running=4, finished_lifetime=timedelta(seconds=3600)): """ @type max_running: int @param max_running: maximum number of tasks to run simultaneously None means indefinitely @type finished_lifetime: datetime.timedelta instance @param finished_lifetime: length of time to keep finished tasks @return:... | 453,967 |
def _dispatch(self): """ Scheduling method that that executes the scheduling hooks. """ self.__lock.acquire() try: while True: self.__condition.wait(self.__dispatcher_timeout) for task in self._get_tasks(): self.run(task) self._cancel_tasks() self._timeout_tasks() self._cull_tasks() except Exception: _log.critical('Exc... | def _dispatch(self): """ Scheduling method that that executes the scheduling hooks. """ self.__lock.acquire() try: while True: self.__condition.wait(self.__dispatcher_timeout) for task in self._get_tasks(): self.run(task) self._cancel_tasks() self._timeout_tasks() self._cull_tasks() except Exception: _log.critical('Exc... | 453,968 |
def repository(self, id): method = "/repositories/%s" % str(id) return self.conn.request_get(method) | def repository(self, id): method = "/repositories/%s/" % str(id) return self.conn.request_get(method) | 453,969 |
def clean(self): pass | def clean(self): pass | 453,970 |
def clean(self): pass | def clean(self): pass | 453,971 |
def clean(self): pass | def clean(self): pass | 453,972 |
def packages(self, id): """ Get a consumer's set of packages @param id: consumer id @return: consumer's installed packages """ valid_filters = ('name', 'arch') filters = self.filters(valid_filters) packages = API.packages(id).avlues() filtered_packages = self.filter_results(packages, filters, valid_filters) return self... | def packages(self, id): """ Get a consumer's set of packages @param id: consumer id @return: consumer's installed packages """ valid_filters = ('name', 'arch') filters = self.filters(valid_filters) packages = API.packages(id).values() filtered_packages = self.filter_results(packages, filters, valid_filters) return self... | 453,973 |
def _create_published_link(self, repo): if not os.path.isdir(self.published_path): os.mkdir(self.published_path) source_path = os.path.join(pulp.server.util.top_repos_location(), repo["relative_path"]) link_path = os.path.join(self.published_path, repo["relative_path"]) pulp.server.util.create_symlinks(source_path, lin... | def _create_published_link(self, repo): if not os.path.isdir(self.published_path): os.makedirs(self.published_path) source_path = os.path.join(pulp.server.util.top_repos_location(), repo["relative_path"]) link_path = os.path.join(self.published_path, repo["relative_path"]) pulp.server.util.create_symlinks(source_path, ... | 453,974 |
def _create(self): if not self.options.userlogin: print("userlogin required. Try --help") sys.exit(0) if not self.options.name: self.options.name = "" if not self.options.userpassword: self.options.userpassword = "" try: user = self.userconn.create(self.options.newusername, self.options.newpassword, self.options.name) ... | def _create(self): if not self.options.newusername: print("newusername required. Try --help") sys.exit(0) if not self.options.name: self.options.name = "" if not self.options.userpassword: self.options.userpassword = "" try: user = self.userconn.create(self.options.newusername, self.options.newpassword, self.options.na... | 453,975 |
def _create(self): if not self.options.userlogin: print("userlogin required. Try --help") sys.exit(0) if not self.options.name: self.options.name = "" if not self.options.userpassword: self.options.userpassword = "" try: user = self.userconn.create(self.options.newusername, self.options.newpassword, self.options.name) ... | def _create(self): if not self.options.userlogin: print("userlogin required. Try --help") sys.exit(0) if not self.options.name: self.options.name = "" if not self.options.newpassword: self.options.newpassword = "" try: user = self.userconn.create(self.options.newusername, self.options.newpassword, self.options.name) pr... | 453,976 |
def _list(self): try: users = self.userconn.users() columns = ["login", "name"] if not len(users): print _("No users available to list") sys.exit(0) print "+-------------------------------------------+" print " Available Users " print "+-------------------------------------------+" for user ... | def _list(self): try: users = self.userconn.users() if not len(users): print _("No users available to list") sys.exit(0) print "+-------------------------------------------+" print " Available Users " print "+-------------------------------------------+" for user in users: print constants.AV... | 453,977 |
def run(self): id = self.get_required_option('id') if not self.opts.pkgname: system_exit(os.EX_USAGE, _("Error, atleast one package id is required to perform a delete.")) pids = [] for pkg in self.opts.pkgname: pinfo = self.pconn.get_package_by_filename(id, pkg) pids.append(pinfo) try: if pinfo: self.pconn.remove_packa... | def run(self): id = self.get_required_option('id') if not self.opts.pkgname: system_exit(os.EX_USAGE, _("Error, atleast one package id is required to perform a delete.")) pids = [] for pkg in self.opts.pkgname: pinfo = self.pconn.get_package_by_filename(id, pkg) pids.append(pinfo) try: if pinfo: self.pconn.remove_packa... | 453,978 |
def run(self): id = self.get_required_option('id') if not self.opts.errataid: system_exit(os.EX_USAGE, _("Error, atleast one erratum id is required to perform an add.")) if not self.opts.srcrepo: system_exit(os.EX_USAGE, _("Error, a source respository where erratum exists is required")) errataids = self.opts.errataid t... | def run(self): id = self.get_required_option('id') if not self.opts.errataid: system_exit(os.EX_USAGE, _("Error, atleast one erratum id is required to perform an add.")) if not self.opts.srcrepo: system_exit(os.EX_USAGE, _("Error, a source respository where erratum exists is required")) errataids = self.opts.errataid t... | 453,979 |
def run(self): id = self.get_required_option('id') if not self.opts.errataid: system_exit(os.EX_USAGE, _("Error, atleast one erratum id is required to perform a delete.")) errataids = self.opts.errataid try: self.pconn.delete_errata(id, errataids) except Exception: raise print _("Unable to remove errata [%s] to repo [%... | def run(self): id = self.get_required_option('id') if not self.opts.errataid: system_exit(os.EX_USAGE, _("Error, atleast one erratum id is required to perform a delete.")) errataids = self.opts.errataid try: self.pconn.delete_errata(id, errataids) except Exception: print _("Unable to remove errata [%s] to repo [%s]" % ... | 453,980 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | 453,981 |
def relink(self): """ Relink GPG key files. """ linked = [] self.clean() for path in self.keyfiles(): fn = os.path.basename(path) dst = os.path.join(lnkdir(), self.path, fn) self.link(path, dst) entry = os.path.join(self.path, fn) linked.append(entry) return linked | def relink(self): """ Relink GPG key files. """ linked = [] self.clean() for path, content in self.keyfiles(): fn = os.path.basename(path) dst = os.path.join(lnkdir(), self.path, fn) self.link(path, dst) entry = os.path.join(self.path, fn) linked.append(entry) return linked | 453,982 |
def _create(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.name: self.options.name = self.options.id if not self.options.arch: self.options.arch = "noarch" | def _create(self): if not self.options.id: print _("repo id required. Try --help") sys.exit(0) if not self.options.name: self.options.name = self.options.id if not self.options.arch: self.options.arch = "noarch" | 453,983 |
def _create(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.name: self.options.name = self.options.id if not self.options.arch: self.options.arch = "noarch" | def _create(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.name: self.options.name = self.options.id if not self.options.arch: self.options.arch = "noarch" | 453,984 |
def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) status... | def _sync(self): if not self.options.id: print _("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) stat... | 453,985 |
def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) status... | def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print _("Task created with ID::"), task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) sta... | 453,986 |
def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) status... | def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) status... | 453,987 |
def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) status... | def _sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: task_object = self.pconn.sync(self.options.id, self.options.timeout) state = "waiting" print "Task created with ID::", task_object['id'] while state not in ["finished", "error", 'timed out', 'canceled']: time.sleep(5) status... | 453,988 |
def _cancel_sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.taskid: print("task id required. Try --help") sys.exit(0) try: repos = self.pconn.cancel_sync(self.options.id, self.options.taskid) print _(" Sync task %s cancelled") % self.options.taskid except Restli... | def _cancel_sync(self): if not self.options.id: print _("repo id required. Try --help") sys.exit(0) if not self.options.taskid: print("task id required. Try --help") sys.exit(0) try: repos = self.pconn.cancel_sync(self.options.id, self.options.taskid) print _(" Sync task %s cancelled") % self.options.taskid except Rest... | 453,989 |
def _cancel_sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.taskid: print("task id required. Try --help") sys.exit(0) try: repos = self.pconn.cancel_sync(self.options.id, self.options.taskid) print _(" Sync task %s cancelled") % self.options.taskid except Restli... | def _cancel_sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.taskid: print _("task id required. Try --help") sys.exit(0) try: repos = self.pconn.cancel_sync(self.options.id, self.options.taskid) print _(" Sync task %s cancelled") % self.options.taskid except Rest... | 453,990 |
def _cancel_sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.taskid: print("task id required. Try --help") sys.exit(0) try: repos = self.pconn.cancel_sync(self.options.id, self.options.taskid) print _(" Sync task %s cancelled") % self.options.taskid except Restli... | def _cancel_sync(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) if not self.options.taskid: print("task id required. Try --help") sys.exit(0) try: repos = self.pconn.cancel_sync(self.options.id, self.options.taskid) print _(" Sync task %s canceled") % self.options.taskid except Restlib... | 453,991 |
def _delete(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: self.pconn.delete(id=self.options.id) print _(" Successful deleted Repo [ %s ] " % self.options.id) except RestlibException, re: print _(" Deleted operation failed on Repo [ %s ] " % self.options.id) log.error("Error: %s" ... | def _delete(self): if not self.options.id: print _("repo id required. Try --help") sys.exit(0) try: self.pconn.delete(id=self.options.id) print _(" Successful deleted Repo [ %s ] " % self.options.id) except RestlibException, re: print _(" Deleted operation failed on Repo [ %s ] " % self.options.id) log.error("Error: %s... | 453,992 |
def _delete(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: self.pconn.delete(id=self.options.id) print _(" Successful deleted Repo [ %s ] " % self.options.id) except RestlibException, re: print _(" Deleted operation failed on Repo [ %s ] " % self.options.id) log.error("Error: %s" ... | def _delete(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: self.pconn.delete(id=self.options.id) print _(" Successful deleted Repo [ %s ]") % self.options.id except RestlibException, re: print _(" Deleted operation failed on Repo [ %s ]") % self.options.id log.error("Error: %s" % ... | 453,993 |
def _delete(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: self.pconn.delete(id=self.options.id) print _(" Successful deleted Repo [ %s ] " % self.options.id) except RestlibException, re: print _(" Deleted operation failed on Repo [ %s ] " % self.options.id) log.error("Error: %s" ... | def _delete(self): if not self.options.id: print("repo id required. Try --help") sys.exit(0) try: self.pconn.delete(id=self.options.id) print _(" Successful deleted Repo [ %s ] " % self.options.id) except RestlibException, re: print _(" Deleted operation failed on Repo [ %s ] " % self.options.id) log.error("Error: %s" ... | 453,994 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print _("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atl... | 453,995 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print _("Need to provide at ... | 453,996 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | 453,997 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | 453,998 |
def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | def _upload(self): (self.options, files) = self.parser.parse_args() # ignore the command and pick the files files = files[2:] if not self.options.id: print("repo id required. Try --help") sys.exit(0) if self.options.dir: files += utils.processDirectory(self.options.dir, "rpm") if not files: print("Need to provide atlea... | 453,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.