bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
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... | 454,000 |
def bark(self, words): return self.BRKMSG % words | def bark(self, words): return self.BRKMSG % words | 454,001 |
def testSynchronous(self): results = [] __agent = TestAgent(self.ID) agent = RemoteAgent(self.ID) dog = agent.Dog() r = agent.dog.bark('pulp rocks!') results.append(r) r = dog.wag(self.WAGS) results.append(r) self.validate(results) agent.close() | def testSynchronous(self): results = [] __agent = TestAgent(self.ID) agent = RemoteAgent(self.ID) dog = agent.Dog() r = dog.bark('pulp rocks!') results.append(r) r = dog.wag(self.WAGS) results.append(r) self.validate(results) agent.close() | 454,002 |
def delete(self, prev): """ Delete for this repository. Pattern matching used to be sure that only keys stored for this repository are deleted. A cloned repo may have it's parent's keys in the keylist. @param prev: The current list of (relateive paths) keys. @type prev: [str,..] @return: A list of deleted (relateive p... | def delete(self, prev): """ Delete for this repository. Pattern matching used to be sure that only keys stored for this repository are deleted. A cloned repo may have it's parent's keys in the keylist. @param prev: The current list of (relateive paths) keys. @type prev: [str,..] @return: A list of deleted (relateive p... | 454,003 |
def _raise_exception_in_thread(tid, exc_type): """ Raises an exception in the threads with id tid. """ assert inspect.isclass(exc_type) # NOTE this returns the number of threads that it modified, which should # only be 1 or 0 (if the thread id wasn't found) long_tid = ctypes.c_long(tid) exc_ptr = ctypes.py_object(exc_t... | def _raise_exception_in_thread(tid, exc_type): """ Raises an exception in the threads with id tid. """ assert inspect.isclass(exc_type) # NOTE this returns the number of threads that it modified, which should # only be 1 or 0 (if the thread id wasn't found) long_tid = ctypes.c_long(tid) exc_ptr = ctypes.py_object(exc_t... | 454,004 |
def package_updates(self, id): """ list applicable package updates for a given consumerid. @type id: str @param id: consumer id """ return self.ok(consumer_api.list_package_updates(id)) | def package_updates(self, id): """ list applicable package updates for a given consumerid. @type id: str @param id: consumer id """ return self.ok(consumer_api.list_package_updates(id)) | 454,005 |
def update(self, user): method = "/users/%s/" % consumergroup['id'] return self.conn.request_put(method, params=user) | def update(self, user): method = "/users/%s/" % user['id'] return self.conn.request_put(method, params=user) | 454,006 |
def sync(self, repo, repo_source, progress_callback=None): pkg_dir = urlparse(repo_source['url']).path.encode('ascii', 'ignore') log.debug("sync of %s for repo %s" % (pkg_dir, repo['id'])) try: repo_dir = "%s/%s" % (repos_location(), repo['id']) if not os.path.exists(pkg_dir): raise InvalidPathError("Path %s is invalid... | deflog.debug('Expected Package Location: %s' % pkg_location) sync(self,log.debug('Expected Package Location: %s' % pkg_location) repo,log.debug('Expected Package Location: %s' % pkg_location) repo_source,log.debug('Expected Package Location: %s' % pkg_location) progress_callback=None):log.debug('Expected Package Locati... | 454,007 |
def add_packages_to_group(self, repoid, groupid, pkg_names=[], gtype="default"): """ @param repoid: repository id @param groupid: group id @param pkg_names: package names @param gtype: OPTIONAL type of package group, example "mandatory", "default", "optional" """ repo = self._get_existing_repo(repoid) if groupid not in... | def add_packages_to_group(self, repoid, groupid, pkg_names=[], gtype="default"): """ @param repoid: repository id @param groupid: group id @param pkg_names: package names @param gtype: OPTIONAL type of package group, example "mandatory", "default", "optional" """ repo = self._get_existing_repo(repoid) if groupid not in... | 454,008 |
def tearDown(self): # self.clean() pass | def tearDown(self): # self.clean()self.clean() | 454,009 |
def import_groups_data(self, compsfile, repo): """ Reads a comps.xml or comps.xml.gz under repodata from dir Loads PackageGroup and Category info our db """ try: comps = yum.comps.Comps() comps.add(compsfile) for c in comps.categories: ctg = model.PackageGroupCategory(c.categoryid, c.name, c.description, c.display_orde... | def import_groups_data(self, compsfile, repo): """ Reads a comps.xml or comps.xml.gz under repodata from dir Loads PackageGroup and Category info our db """ try: comps = yum.comps.Comps() comps.add(compsfile) for c in comps.categories: ctg = model.PackageGroupCategory(c.categoryid, c.name, c.description, c.display_orde... | 454,010 |
def __init__(self): usage = "usage: %prog package [OPTIONS]" shortdesc = "package specific actions to pulp server." desc = "" | def __init__(self): usage = "usage: %prog package [OPTIONS]" shortdesc = "package specific actions to pulp server." desc = "" | 454,011 |
def generate_options(self): self.action = self._get_action() if self.action == "info": usage = "package info [OPTIONS]" self.setup_option_parser(usage, "", True) self.parser.add_option("-p", "--name", dest="name", help="package name to lookup") self.parser.add_option("--repoid", dest="repoid", help="Repository Label") ... | def generate_options(self): self.action = self._get_action() if self.action == "info": usage = "package info [OPTIONS]" self.setup_option_parser(usage, "", True) self.parser.add_option("-n", "--name", dest="name", help="package name to lookup") self.parser.add_option("--repoid", dest="repoid", help="Repository Label") ... | 454,012 |
def generate_options(self): self.action = self._get_action() if self.action == "info": usage = "package info [OPTIONS]" self.setup_option_parser(usage, "", True) self.parser.add_option("-p", "--name", dest="name", help="package name to lookup") self.parser.add_option("--repoid", dest="repoid", help="Repository Label") ... | def generate_options(self): self.action = self._get_action() if self.action == "info": usage = "package info [OPTIONS]" self.setup_option_parser(usage, "", True) self.parser.add_option("-p", "--name", dest="name", help="package name to lookup") self.parser.add_option("--repoid", dest="repoid", help="Repository Label") ... | 454,013 |
def setup_parser(self): super(Update, self).setup_parser() self.parser.add_option("--name", dest="name", help=_("common repository name")) self.parser.add_option("--arch", dest="arch", help=_("package arch the repository should support")) self.parser.add_option("--feed", dest="feed", help=_("url feed to populate the re... | def setup_parser(self): super(Update, self).setup_parser() self.parser.add_option("--name", dest="name", help=_("common repository name")) self.parser.add_option("--arch", dest="arch", help=_("package arch the repository should support")) self.parser.add_option("--feed", dest="feed", help=_("url feed to populate the re... | 454,014 |
def run(self): id = self.get_required_option('id') repo = self.pconn.repository(id) files = repo['files'] packages = self.pconn.packages(id) print_header(_('Contents of %s') % id) print _('files in %s:') % id if not files: print _(' none') else: for f in sorted(repo['files']): print ' ' + f print _('packages in %s:') %... | def run(self): id = self.get_required_option('id') repo = self.pconn.repository(id) files = repo['files'] packages = self.pconn.packages(id) print_header(_('Contents of %s') % id) print _('files in %s:') % id if not files: print _(' none') else: for f in sorted(repo['files']): print ' ' + f print _('packages in %s:') %... | 454,015 |
def GET(self, id, action_name): ''' Retrieve a map of all repository IDs to their associated synchronization schedules. | def GET(self): ''' Retrieve a map of all repository IDs to their associated synchronization schedules. | 454,016 |
def test_duplicate(self): id = 'test_duplicate_distro' distro = self.dapi.create(id, None, None, []) assert(distro is not None) status = False try: distro = self.dapi.create(id, None, None, []) except DuplicateKeyError: status = True self.assertTrue(status) | def test_duplicate(self): id = 'test_duplicate_distro' distro = self.dapi.create(id, None, None, []) assert(distro is not None) status = False try: distro = self.dapi.create(id, None, None, []) except DuplicateKeyError: status = True self.assertTrue(status) | 454,017 |
def _add_consumer(self, consumergroup, consumer): """ Responsible for properly associating a Consumer to a ConsumerGroup """ consumerids = consumergroup['consumerids'] if (consumerids.contains(consumer["id"])): # No need to update group return consumerids.append(consumer["id"]) consumergroup["consumerids"] = consumerid... | def _add_consumer(self, consumergroup, consumer): """ Responsible for properly associating a Consumer to a ConsumerGroup """ consumerids = consumergroup['consumerids'] if (consumerids.contains(consumer["id"])): # No need to update group return consumerids.append(consumer["id"]) consumergroup["consumerids"] = consumerid... | 454,018 |
def installpackages(self, id, packagenames=[]): """ Install packages on the consumer. @param id: A consumer id. @type id: str @param packagenames: The package names to install. @type packagenames: [str,..] """ agent = Agent(id) data = [] for pkg in packagenames: info = pkg.split('.') if len(info) > 1: data.append(('.'.... | def installpackages(self, id, packagenames=[]): """ Install packages on the consumer. @param id: A consumer id. @type id: str @param packagenames: The package names to install. @type packagenames: [str,..] """ agent = Agent(id) data = [] for pkg in packagenames: info = pkg.split('.') if len(info) > 1: data.append(('.'.... | 454,019 |
def import_package(self, pkg_path, repo): packages = repo['packages'] if (pkg_path.endswith(".rpm")): try: info = pulp.util.getRPMInformation(pkg_path) p = self.package_api.package(info['name']) if not p: p = self.package_api.create(info['name'], info['description']) | def import_package(self, pkg_path, repo): packages = repo['packages'] if (pkg_path.endswith(".rpm")): try: info = pulp.util.getRPMInformation(pkg_path) p = self.package_api.package(info['name']) if not p: p = self.package_api.create(info['name'], info['description']) | 454,020 |
def __init__(self, id=getuuid(), host='localhost', port=5672): """ @param host: The broker fqdn or IP. @type host: str @param port: The broker port. @type port: str """ self.id = id self.host = host self.port = port self.__session = None self.connect() self.open() | def __init__(self, id=None, host='localhost', port=5672): """ @param host: The broker fqdn or IP. @type host: str @param port: The broker port. @type port: str """ self.id = id self.host = host self.port = port self.__session = None self.connect() self.open() | 454,021 |
def __init__(self, id=getuuid(), host='localhost', port=5672): """ @param host: The broker fqdn or IP. @type host: str @param port: The broker port. @type port: str """ self.id = id self.host = host self.port = port self.__session = None self.connect() self.open() | def __init__(self, id=getuuid(), host='localhost', port=5672): """ @param host: The broker fqdn or IP. @type host: str @param port: The broker port. @type port: str """ self.id = ( id or getuuid() ) self.host = host self.port = port self.__session = None self.connect() self.open() | 454,022 |
def __init__(self, storage, dispatcher_timeout=0.5): """ @type dispatcher_timeout: float @param dispatcher_timeout: the max number of seconds before the dispatcher wakes up to run tasks """ self._storage = storage self._lock = threading.RLock() self._condition = threading.Condition(self._lock) self._dispatcher = thre... | def __init__(self, storage, dispatcher_timeout=0.5): """ @type dispatcher_timeout: float @param dispatcher_timeout: the max number of seconds before the dispatcher wakes up to run tasks """ self._storage = storage self._lock = threading.RLock() self._condition = threading.Condition(self._lock) self._dispatcher = thre... | 454,023 |
def _dispatch(self): """ Scheduling method that that executes the scheduling hooks This should not be overridden by a derived class """ self._lock.acquire() while True: self._condition.wait(self._dipatcher_timeout) self._initial_runs() for task in self._get_tasks(): self._pre_run(task) self._run(task) self._post_run(ta... | def _dispatch(self): """ Scheduling method that that executes the scheduling hooks This should not be overridden by a derived class """ self._lock.acquire() while True: self._condition.wait(self._dispatcher_timeout) self._initial_runs() for task in self._get_tasks(): self._pre_run(task) self._run(task) self._post_run(t... | 454,024 |
def DELETE(self, id, action_name, action_id): """ Cancel an action """ task = self.find_task(id) if task is None: return self.not_found('No %s with id %s found' % (action_name, action_id)) if self.cancel_task(id): return self.accepted({'status_uri': http.uri_path()}) # action is complete and, therfore, not cancelled # ... | def DELETE(self, id, action_name, action_id): """ Cancel an action """ task = self.find_task(action_id) if task is None: return self.not_found('No %s with id %s found' % (action_name, action_id)) if self.cancel_task(id): return self.accepted({'status_uri': http.uri_path()}) # action is complete and, therfore, not cance... | 454,025 |
def DELETE(self, id, action_name, action_id): """ Cancel an action """ task = self.find_task(id) if task is None: return self.not_found('No %s with id %s found' % (action_name, action_id)) if self.cancel_task(id): return self.accepted({'status_uri': http.uri_path()}) # action is complete and, therfore, not cancelled # ... | def DELETE(self, id, action_name, action_id): """ Cancel an action """ task = self.find_task(id) if task is None: return self.not_found('No %s with id %s found' % (action_name, action_id)) if self.cancel_task(action_id): return self.accepted(self._task_to_dict(task)) # action is complete and, therfore, not cancelled # ... | 454,026 |
def test_duplicate(self): id = uuid.uuid4() login = 'dupe-test' user = self.uapi.create(login, id) try: user = self.uapi.create(login, id) raise Exception, 'Duplicate allowed' except: pass | def test_duplicate(self): id = uuid.uuid4() login = 'dupe-test' user = self.uapi.create(login=login, id=id) try: user = self.uapi.create(login=login, id=id) raise Exception, 'Duplicate allowed' except: pass | 454,027 |
def test_duplicate(self): id = uuid.uuid4() login = 'dupe-test' user = self.uapi.create(login, id) try: user = self.uapi.create(login, id) raise Exception, 'Duplicate allowed' except: pass | def test_duplicate(self): id = uuid.uuid4() login = 'dupe-test' user = self.uapi.create(login=login, id=id) try: user = self.uapi.create(login=login, id=id) raise Exception, 'Duplicate allowed' except: pass | 454,028 |
def http_authorization(): """ Return the current http authorization credentials, if any @return: str representing the http authorization credentials if found, None otherwise """ credentials = web.ctx.environ.get('HTTP_AUTHORIZATION', None) return credentials | def http_authorization(): """ Return the current http authorization credentials, if any @return: str representing the http authorization credentials if found, None otherwise """ return web.ctx.environ.get('HTTP_AUTHORIZATION', None) | 454,029 |
def resource_path(): """ Return the uri path with the /pulp/api prefix stripped off @rtype: str @return: uri formatted path """ parts = [p for p in uri_path().split('/') if p][2:] if not parts: return '/' return '/%s/' % '/'.join(parts) | def resource_path(): """ Return the uri path with the /pulp/api prefix stripped off @rtype: str @return: uri formatted path """ parts = [p for p in uri_path().split('/') if p] assert parts[:2] == ('pulp', 'api') parts = parts[2:] if not parts: return '/' return '/%s/' % '/'.join(parts) | 454,030 |
def setup_parser(self): help = _("consumer identifier eg: foo.example.com") default = None if hasattr(self, id): help = SUPPRESS_HELP default = self.id self.parser.add_option("--id", dest="id", default=default, help=help) | def setup_parser(self): help = _("consumer identifier eg: foo.example.com") default = None if hasattr(self, 'id'): help = SUPPRESS_HELP default = self.id self.parser.add_option("--id", dest="id", default=default, help=help) | 454,031 |
def _process_repo_images(self, repodir, repo): log.debug("Processing any images synced as part of the repo") images_dir = os.path.join(repodir, "images") if not os.path.exists(images_dir): log.info("No image files to import to repo..") return # Handle distributions that are part of repo syncs files = pulp.server.util.l... | def _process_repo_images(self, repodir, repo): log.debug("Processing any images synced as part of the repo") images_dir = os.path.join(repodir, "images") if not os.path.exists(images_dir): log.info("No image files to import to repo..") return # Handle distributions that are part of repo syncs files = pulp.server.util.l... | 454,032 |
def sync(self, repo, repo_source): cacert = clicert = clikey = None if repo['ca'] and repo['cert'] and repo['key']: cacert = repo['ca'].encode('utf8') clicert = repo['cert'].encode('utf8') clikey = repo['key'].encode('utf8') yfetch = YumRepoGrinder(repo['id'], repo_source['url'].encode('ascii', 'ignore'), 1, cacert=cac... | def sync(self, repo, repo_source): cacert = clicert = clikey = None if repo['ca'] and repo['cert'] and repo['key']: cacert = repo['ca'].encode('utf8') clicert = repo['cert'].encode('utf8') clikey = repo['key'].encode('utf8') yfetch = YumRepoGrinder(repo['id'], repo_source['url'].encode('ascii', 'ignore'), 1, cacert=cac... | 454,033 |
def sync(self, repo, repo_source): # Parse the repo source for necessary pieces # Expected format: <server>/<channel> pieces = repo_source['url'].split('/') if len(pieces) < 2: raise PulpException('Feed format for RHN type must be <server>/<channel>. Feed: %s', repo_source['url']) | def sync(self, repo, repo_source): # Parse the repo source for necessary pieces # Expected format: <server>/<channel> pieces = repo_source['url'].split('/') if len(pieces) < 2: raise PulpException('Feed format for RHN type must be <server>/<channel>. Feed: %s', repo_source['url']) | 454,034 |
def generate_updateinfo(repo): """ Method to generate updateinfo xml for a given repo, write to file and update repomd.xml with new updateinfo @param repo: repo object with errata to generate updateinfo.xml @type repo: repository object """ um = UpdateMetadata() un = UpdateNotice() eapi = ErrataApi() if not repo['err... | def generate_updateinfo(repo): """ Method to generate updateinfo xml for a given repo, write to file and update repomd.xml with new updateinfo @param repo: repo object with errata to generate updateinfo.xml @type repo: repository object """ um = UpdateMetadata() un = UpdateNotice() eapi = ErrataApi() if not repo['err... | 454,035 |
def generate_updateinfo(repo): """ Method to generate updateinfo xml for a given repo, write to file and update repomd.xml with new updateinfo @param repo: repo object with errata to generate updateinfo.xml @type repo: repository object """ um = UpdateMetadata() un = UpdateNotice() eapi = ErrataApi() if not repo['err... | def generate_updateinfo(repo): """ Method to generate updateinfo xml for a given repo, write to file and update repomd.xml with new updateinfo @param repo: repo object with errata to generate updateinfo.xml @type repo: repository object """ um = UpdateMetadata() un = UpdateNotice() eapi = ErrataApi() if not repo['err... | 454,036 |
def __init__(self, version): """ @type version: int @param version: data model version this model represents """ self._id = version self.version = version self.validated = False | def __init__(self, version): """ @type version: int @param version: data model version this model represents """ self._id = version self.version = version self.validated = False | 454,037 |
def _get_latest_version(): """ Utility function to fetch the latest DataModelVersion model from the db. @rtype: L{DataModelVersion} instance @return: the data model intance with the most recent version """ assert _version_db is not None versions = _version_db.find() if not versions: return None versions.sort({'version'... | def _get_latest_version(): """ Utility function to fetch the latest DataModelVersion model from the db. @rtype: L{DataModelVersion} instance @return: the data model intance with the most recent version """ _init_db() versions = _version_db.find() if not versions: return None versions.sort({'version': pymongo.DESCENDING... | 454,038 |
def _get_latest_version(): """ Utility function to fetch the latest DataModelVersion model from the db. @rtype: L{DataModelVersion} instance @return: the data model intance with the most recent version """ assert _version_db is not None versions = _version_db.find() if not versions: return None versions.sort({'version'... | def _get_latest_version(): """ Utility function to fetch the latest DataModelVersion model from the db. @rtype: L{DataModelVersion} instance @return: the data model intance with the most recent version """ assert _version_db is not None versions = _version_db.find() if versions.count() == 0: return None versions.sort({... | 454,039 |
def _get_latest_version(): """ Utility function to fetch the latest DataModelVersion model from the db. @rtype: L{DataModelVersion} instance @return: the data model intance with the most recent version """ assert _version_db is not None versions = _version_db.find() if not versions: return None versions.sort({'version'... | def _get_latest_version(): """ Utility function to fetch the latest DataModelVersion model from the db. @rtype: L{DataModelVersion} instance @return: the data model intance with the most recent version """ assert _version_db is not None versions = _version_db.find() if not versions: return None versions.sort('version',... | 454,040 |
def get_version_in_use(): """ Fetch the data model version currently in use in the db. @rtype: int @return: integer data model version """ assert _version_db is not None v = _get_latest_version() return v.version | def get_version_in_use(): """ Fetch the data model version currently in use in the db. @rtype: int @return: integer data model version """ v = _get_latest_version() return v.version | 454,041 |
def check_version(): """ Check for a version mismatch between the current data model version and the data model version in use in the db. If a mismatch is detected, the mismatch is logged and the application exits. """ assert _version_db is not None v = _get_latest_version() if v.version == VERSION: return _log.critica... | def check_version(): """ Check for a version mismatch between the current data model version and the data model version in use in the db. If a mismatch is detected, the mismatch is logged and the application exits. """ v = _get_latest_version() if v.version == VERSION: return _log.critical('data model version mismatch:... | 454,042 |
def check_version(): """ Check for a version mismatch between the current data model version and the data model version in use in the db. If a mismatch is detected, the mismatch is logged and the application exits. """ assert _version_db is not None v = _get_latest_version() if v.version == VERSION: return _log.critica... | def check_version(): """ Check for a version mismatch between the current data model version and the data model version in use in the db. If a mismatch is detected, the mismatch is logged and the application exits. """ assert _version_db is not None v = _get_latest_version() if v is not None and v.version == VERSION: r... | 454,043 |
def check_version(): """ Check for a version mismatch between the current data model version and the data model version in use in the db. If a mismatch is detected, the mismatch is logged and the application exits. """ assert _version_db is not None v = _get_latest_version() if v.version == VERSION: return _log.critica... | def check_version(): """ Check for a version mismatch between the current data model version and the data model version in use in the db. If a mismatch is detected, the mismatch is logged and the application exits. """ assert _version_db is not None v = _get_latest_version() if v.version == VERSION: return msg = 'data ... | 454,044 |
def set_version(version): """ Set the data model version in the database. @type version: int @param version: data model version """ assert _version_db is not None v = DataModelVersion(version) _version_db.save(v, safe=True) | def set_version(version): """ Set the data model version in the database. @type version: int @param version: data model version """ v = DataModelVersion(version) _version_db.save(v, safe=True) | 454,045 |
def set_version(version): """ Set the data model version in the database. @type version: int @param version: data model version """ assert _version_db is not None v = DataModelVersion(version) _version_db.save(v, safe=True) | def set_version(version): """ Set the data model version in the database. @type version: int @param version: data model version """ assert _version_db is not None v = DataModelVersion(version) _set_version(v) | 454,046 |
def is_validated(): """ Check to see if the latest data model version has been validated. @rtype: bool @return: True if the data model has been validated, False otherwise """ assert _version_db is not None v = _get_latest_version() return v.validated | def is_validated(): """ Check to see if the latest data model version has been validated. @rtype: bool @return: True if the data model has been validated, False otherwise """ v = _get_latest_version() return v.validated | 454,047 |
def set_validated(): """ Flag the latest data model version as validated. """ assert _version_db is not None v = _get_latest_version() v.validated = True _version_db.save(v, safe=True) | def set_validated(): """ Flag the latest data model version as validated. """ v = _get_latest_version() v.validated = True _version_db.save(v, safe=True) | 454,048 |
def set_validated(): """ Flag the latest data model version as validated. """ assert _version_db is not None v = _get_latest_version() v.validated = True _version_db.save(v, safe=True) | def set_validated(): """ Flag the latest data model version as validated. """ assert _version_db is not None v = _get_latest_version() v.validated = True _version_db.save(v, safe=True) | 454,049 |
def yum_rhn_progress_callback(info): fields = ('status', 'item_name', 'items_left', 'items_total', 'size_left', 'size_total') values = tuple(getattr(info, f) for f in fields) log.info("Progress: %s on <%s>, %s/%s items %s/%s bytes" % values) return dict(zip(fields, values)) | def yum_rhn_progress_callback(info): fields = ('status', 'item_name', 'items_left', 'items_total', 'size_left', 'size_total') values = tuple(getattr(info, f) for f in fields) log.debug("Progress: %s on <%s>, %s/%s items %s/%s bytes" % values) return dict(zip(fields, values)) | 454,050 |
def generate_options(self): possiblecmd = [] | def generate_options(self): possiblecmd = [] | 454,051 |
def _add_packages_from_dir(self, dir, repo): dirList = os.listdir(dir) packages = repo['packages'] package_count = 0 for fname in dirList: if (fname.endswith(".rpm")): try: info = getRPMInformation(dir + fname) #p = self.packageApi.package(info['name']) p = self.package(repo["id"], info['name']) if not p: p = self.crea... | def _add_packages_from_dir(self, dir, repo): dirList = os.listdir(dir) packages = repo['packages'] package_count = 0 for fname in dirList: if (fname.endswith(".rpm")): try: info = getRPMInformation(dir + fname) #p = self.packageApi.package(info['name']) p = self.package(repo["id"], info['name']) if not p: p = self.crea... | 454,052 |
def _add_packages_from_dir(self, dir, repo): dirList = os.listdir(dir) packages = repo['packages'] package_count = 0 for fname in dirList: if (fname.endswith(".rpm")): try: info = getRPMInformation(dir + fname) #p = self.packageApi.package(info['name']) p = self.package(repo["id"], info['name']) if not p: p = self.crea... | def _add_packages_from_dir(self, dir, repo): dirList = os.listdir(dir) packages = repo['packages'] package_count = 0 for fname in dirList: if (fname.endswith(".rpm")): try: info = getRPMInformation(dir + fname) #p = self.packageApi.package(info['name']) p = self.package(repo["id"], info['name']) if not p: p = self.crea... | 454,053 |
def _add_packages_from_dir(self, dir, repo): dirList = os.listdir(dir) packages = repo['packages'] package_count = 0 for fname in dirList: if (fname.endswith(".rpm")): try: info = getRPMInformation(dir + fname) #p = self.packageApi.package(info['name']) p = self.package(repo["id"], info['name']) if not p: p = self.crea... | def _add_packages_from_dir(self, dir, repo): dirList = os.listdir(dir) packages = repo['packages'] package_count = 0 for fname in dirList: if (fname.endswith(".rpm")): try: info = getRPMInformation(dir + fname) #p = self.packageApi.package(info['name']) p = self.package(repo["id"], info['name']) if not p: p = self.crea... | 454,054 |
def add_key_value_pair(self, id, key, value): """ Add key-value info to a consumer group. @param id: A consumer group id. @type id: str @param repoid: key @type repoid: str @param value: value @type: str @raise PulpException: When consumer group is not found. """ consumergroup = self.consumergroup(id) if not consumergr... | def add_key_value_pair(self, id, key, value): """ Add key-value info to a consumer group. @param id: A consumer group id. @type id: str @param repoid: key @type repoid: str @param value: value @type: str @raise PulpException: When consumer group is not found. """ consumergroup = self.consumergroup(id) if not consumergr... | 454,055 |
def update_key_value_pair(self, id, key, value): """ Update key-value info of a consumer group. @param id: A consumer group id. @type id: str @param repoid: key @type repoid: str @param value: value @type: str @raise PulpException: When consumer group is not found. """ consumergroup = self.consumergroup(id) if not cons... | def update_key_value_pair(self, id, key, value): """ Update key-value info of a consumer group. @param id: A consumer group id. @type id: str @param repoid: key @type repoid: str @param value: value @type: str @raise PulpException: When consumer group is not found. """ consumergroup = self.consumergroup(id) if not cons... | 454,056 |
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.newpassword: self.options.newpassword = "" 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.newpassword: self.options.newpassword = "" try: user = self.userconn.create(login=self.options.newusername, password=self.options.newpassword, na... | 454,057 |
def get_descendants(thread): """ Get a list of all the descendant threads for the given thread. @type thread: L{TrackedThread} instance @param thread: thread to find the descendants of @raise RuntimeError: if the thread is not an instance of TrackedThread @return: list of TrackedThread instances """ if not isinstance(t... | def get_descendants(thread): """ Get a list of all the descendant threads for the given thread. @type thread: L{TrackedThread} instance @param thread: thread to find the descendants of @raise RuntimeError: if the thread is not an instance of TrackedThread @return: list of TrackedThread instances """ if not isinstance(t... | 454,058 |
def raise_exception(self, exc_type): """ Raise an exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # embedded methods to reduce code duplication def test_exception_event(): return not self._... | def raise_exception(self, exc_type): """ Raise an exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exits. """ # embedded methods to reduce code duplication def test_exception_event(): return not self.__... | 454,059 |
def install(opts): create_dirs(opts) currdir = os.path.abspath(os.path.dirname(__file__)) for l in LINKS: debug(opts, 'creating link: /%s' % l) if os.path.exists('/'+l): debug(opts, '/%s exists, skipping' % l) continue os.symlink(os.path.join(currdir, l), '/'+l) # Link between pulp and apache if not os.path.exists('/v... | def install(opts): create_dirs(opts) currdir = os.path.abspath(os.path.dirname(__file__)) for l in LINKS: debug(opts, 'creating link: /%s' % l) if os.path.exists('/'+l): debug(opts, '/%s exists, skipping' % l) continue os.symlink(os.path.join(currdir, l), '/'+l) # Link between pulp and apache if not os.path.exists('/v... | 454,060 |
def __init__(self): usage = "usage: %prog consumer [OPTIONS]" shortdesc = "consumer specific actions to pulp server." desc = "" | defself.name = "consumer" __init__(self):self.name = "consumer" usageself.name = "consumer" =self.name = "consumer" "usage:self.name = "consumer" %progself.name = "consumer" consumerself.name = "consumer" [OPTIONS]"self.name = "consumer" shortdescself.name = "consumer" =self.name = "consumer" "consumerself.name = "cons... | 454,061 |
def generate_options(self): possiblecmd = [] | def generate_options(self): possiblecmd = [] | 454,062 |
def _do_core(self): self.generate_options() self._validate_options() if self.action == "create": self._create() if self.action == "list": self._list() if self.action == "delete": self._delete() if self.action == "bind": self._bind() if self.action == "unbind": self._unbind() | def _do_core(self): self._validate_options() if self.action == "create": self._create() if self.action == "list": self._list() if self.action == "delete": self._delete() if self.action == "bind": self._bind() if self.action == "unbind": self._unbind() | 454,063 |
def generate_options(self): | def generate_options(self): | 454,064 |
def _do_core(self): self.generate_options() self._validate_options() if self.action == "create": self._create() if self.action == "list": self._list() if self.action == "sync": self._sync() | def _do_core(self): self._validate_options() if self.action == "create": self._create() if self.action == "list": self._list() if self.action == "sync": self._sync() | 454,065 |
def delete(self, id): repo = self._get_existing_repo(id) log.info("Delete API call invoked %s" % repo) #update feed of clones of this repo to None unless they point to origin for clone_id in repo['clone_ids']: cloned_repo = self._get_existing_repo(clone_id) if cloned_repo['source'] != repo['source']: cloned_repo['sourc... | def delete(self, id): repo = self._get_existing_repo(id) log.info("Delete API call invoked %s" % repo) #update feed of clones of this repo to None unless they point to origin for clone_id in repo['clone_ids']: cloned_repo = self._get_existing_repo(clone_id) if cloned_repo['source'] != repo['source']: cloned_repo['sourc... | 454,066 |
def test_repository_with_relativepath(self): repo = self.rapi.create('some-id-mypath', 'some name', \ 'i386', 'yum:http://example.com/mypath', relative_path="/mypath/") found = self.rapi.repository('some-id-mypath') assert(found is not None) assert(found['id'] == 'some-id-mypath') assert(found['relative_path'] == "mypa... | def test_repository_with_relativepath(self): repo = self.rapi.create('some-id-mypath', 'some name', \ 'i386', 'yum:http://example.com/mypath', relative_path="/mypath/") found = self.rapi.repository('some-id-mypath') assert(found is not None) assert(found['id'] == 'some-id-mypath') assert(found['relative_path'] == "mypa... | 454,067 |
def _record_event(): _objdb.insert(event, safe=False, check_keys=False) _log.info('%s called %s.%s on %s' % (principal, api, method_name, params_repr)) | def _record_event(): _objdb.insert(event, safe=False, check_keys=False) _log.info('%s called %s.%s' % (principal, api, method_name)) | 454,068 |
def _record_event(): _objdb.insert(event, safe=False, check_keys=False) _log.info('%s called %s.%s on %s' % (principal, api, method_name, params_repr)) | def _record_event(): _objdb.insert(event, safe=False, check_keys=False) _log.info('%s called %s.%s on %s' % (principal, api, method_name, params_repr)) | 454,069 |
def _bind(self): consumerid = self.getConsumer() if not self.options.repoid: print _("repo id required. Try --help") sys.exit(0) try: self.cconn.bind(consumerid, self.options.repoid) self.repolib.update() print _(" Successfully subscribed consumer [%s] to repo [%s]") % \ (consumerid, self.options.repoid) except Restlib... | def _bind(self): consumerid = self.getConsumer() if not self.options.repoid: print _("repo id required. Try --help") sys.exit(0) try: self.cconn.bind(consumerid, self.options.repoid) if not self.is_admin: self.repolib.update() print _(" Successfully subscribed consumer [%s] to repo [%s]") % \ (consumerid, self.options.... | 454,070 |
def _unbind(self): consumerid = self.getConsumer() if not self.options.repoid: print _("repo id required. Try --help") sys.exit(0) try: self.cconn.unbind(consumerid, self.options.repoid) self.repolib.update() print _(" Successfully unsubscribed consumer [%s] from repo [%s]") % \ (consumerid, self.options.repoid) except... | def _unbind(self): consumerid = self.getConsumer() if not self.options.repoid: print _("repo id required. Try --help") sys.exit(0) try: self.cconn.unbind(consumerid, self.options.repoid) if not self.is_admin: self.repolib.update() print _(" Successfully unsubscribed consumer [%s] from repo [%s]") % \ (consumerid, self.... | 454,071 |
def PUT(self): """ Create a new user @return: user that was created """ user_data = self.params() user = api.create(user_data['login'], user_data['password'], user_data['name']) return self.created(user['id'], user) | def PUT(self): """ Create a new user @return: user that was created """ user_data = self.params() user = api.create(login=user_data['login'], password=user_data['password'], name=user_data['name']) return self.created(user['id'], user) | 454,072 |
def _write_certs_to_disk(self, repoid, cert_data): CONTENT_CERTS_PATH = config.config.get("repos", "content_cert_location") cert_dir = os.path.join(CONTENT_CERTS_PATH, repoid) | def _write_certs_to_disk(self, repoid, cert_data): CONTENT_CERTS_PATH = config.config.get("repos", "content_cert_location") cert_dir = os.path.join(CONTENT_CERTS_PATH, repoid) | 454,073 |
def inbound(cls, action): """ Find the handler B{inbound} method for the specified I{action}. @param action: The I{action} part of an event subject. @type action: str @return: The handler instance method. @rtype: instancemethod """ mutex.acquire() try: method = cls.inbounds.get(action) if method is None: raise Exceptio... | def inbound(cls, action): """ Find the handler B{inbound} method for the specified I{action}. @param action: The I{action} part of an event subject. @type action: str @return: The handler instance method. @rtype: instancemethod """ mutex.acquire() try: method = cls.inbounds.get(action) if method is None: raise Exceptio... | 454,074 |
def outbound(cls, action): """ Find the handler B{outbound} method for the specified I{action}. @param action: The I{action} part of an event subject. @type action: str @return: The handler instance method. @rtype: instancemethod """ mutex.acquire() try: method = cls.outbounds.get(action) if method is None: raise Excep... | def outbound(cls, action): """ Find the handler B{outbound} method for the specified I{action}. @param action: The I{action} part of an event subject. @type action: str @return: The handler instance method. @rtype: instancemethod """ mutex.acquire() try: method = cls.outbounds.get(action) if method is None: raise Excep... | 454,075 |
def _tid(thread): """ Determine a thread's id. """ if not thread.is_alive(): raise threading.ThreadError('Thread is not active') if hasattr(thread, '_thread_id'): return thread._thread_id for tid, tobj in threading._active.items(): if tobj is thread: thread._thread_id = tid return tid raise AssertionError('Could not de... | def _tid(thread): """ Determine a thread's id. """ if not thread.is_alive(): raise _ThreadInterruptionError('Thread is not active') if hasattr(thread, '_thread_id'): return thread._thread_id for tid, tobj in threading._active.items(): if tobj is thread: thread._thread_id = tid return tid raise AssertionError('Could not... | 454,076 |
def _tid(thread): """ Determine a thread's id. """ if not thread.is_alive(): raise threading.ThreadError('Thread is not active') if hasattr(thread, '_thread_id'): return thread._thread_id for tid, tobj in threading._active.items(): if tobj is thread: thread._thread_id = tid return tid raise AssertionError('Could not de... | def _tid(thread): """ Determine a thread's id. """ if not thread.is_alive(): raise threading.ThreadError('Thread is not active') if hasattr(thread, '_thread_id'): return thread._thread_id for tid, tobj in threading._active.items(): if tobj is thread: thread._thread_id = tid return tid raise _ThreadInterruptionError('Co... | 454,077 |
def _raise_exception_in_thread(tid, exc_type): """ Raises an exception in the threads with id tid. """ assert inspect.isclass(exc_type) # NOTE this returns the number of threads that it modified, which should # only be 1 or 0 (if the thread id wasn't found) long_tid = ctypes.c_long(tid) exc_ptr = ctypes.py_object(exc_t... | def _raise_exception_in_thread(tid, exc_type): """ Raises an exception in the threads with id tid. """ assert inspect.isclass(exc_type) # NOTE this returns the number of threads that it modified, which should # only be 1 or 0 (if the thread id wasn't found) long_tid = ctypes.c_long(tid) exc_ptr = ctypes.py_object(exc_t... | 454,078 |
def _raise_exception_in_thread(tid, exc_type): """ Raises an exception in the threads with id tid. """ assert inspect.isclass(exc_type) # NOTE this returns the number of threads that it modified, which should # only be 1 or 0 (if the thread id wasn't found) long_tid = ctypes.c_long(tid) exc_ptr = ctypes.py_object(exc_t... | def _raise_exception_in_thread(tid, exc_type): """ Raises an exception in the threads with id tid. """ assert inspect.isclass(exc_type) # NOTE this returns the number of threads that it modified, which should # only be 1 or 0 (if the thread id wasn't found) long_tid = ctypes.c_long(tid) exc_ptr = ctypes.py_object(exc_t... | 454,079 |
def raise_exception(self, exc_type): """ Raise and exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # first, kill off all the descendants for thread in get_descendants(self): while thread.is... | def raise_exception(self, exc_type): """ Raise and exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # first, kill off all the descendants for thread in get_descendants(self): while thread.is... | 454,080 |
def raise_exception(self, exc_type): """ Raise and exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # first, kill off all the descendants for thread in get_descendants(self): while thread.is... | def raise_exception(self, exc_type): """ Raise and exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # first, kill off all the descendants for thread in get_descendants(self): while thread.is... | 454,081 |
def raise_exception(self, exc_type): """ Raise and exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # first, kill off all the descendants for thread in get_descendants(self): while thread.is... | def raise_exception(self, exc_type): """ Raise and exception in this thread. NOTE this is executed in the context of the calling thread and blocks until the exception has been delivered to this thread and this thread exists. """ # first, kill off all the descendants for thread in get_descendants(self): while thread.is... | 454,082 |
def run(self): id = self.get_required_option('id') repo = self.pconn.repository(id) syncs = self.pconn.sync_list(id) print_header(_('Status for %s') % id) print _('Repository: %s') % repo['id'] print _('Number of Packages: %d') % repo['package_count'] last_sync = repo['last_sync'] if last_sync is None: last_sync = 'nev... | def run(self): id = self.get_required_option('id') repo = self.get_repo(id) syncs = self.pconn.sync_list(id) print_header(_('Status for %s') % id) print _('Repository: %s') % repo['id'] print _('Number of Packages: %d') % repo['package_count'] last_sync = repo['last_sync'] if last_sync is None: last_sync = 'never' else... | 454,083 |
def run(self): id = self.get_required_option('id') repo = self.pconn.repository(id) files = repo['files'] packages = self.pconn.packages(id) print_header(_('Contents of %s') % id) print _('files in %s:') % id if not files: print _(' none') else: for f in sorted(repo['files']): print ' ' + f print _('packages in %s:') %... | def run(self): id = self.get_required_option('id') repo = self.get_repo(id) files = repo['files'] packages = self.pconn.packages(id) print_header(_('Contents of %s') % id) print _('files in %s:') % id if not files: print _(' none') else: for f in sorted(repo['files']): print ' ' + f print _('packages in %s:') % id if n... | 454,084 |
def run(self): id = self.get_required_option('id') name = self.opts.name or id arch = self.opts.arch or 'noarch' feed = self.opts.feed symlinks = self.opts.symlinks or False schedule = self.opts.schedule relative_path = self.opts.relativepath groupid = self.opts.groupid cert_data = self._get_cert_options() keylist = se... | def run(self): id = self.get_required_option('id') name = self.opts.name or id arch = self.opts.arch or 'noarch' feed = self.opts.feed symlinks = self.opts.symlinks or False schedule = self.opts.schedule relative_path = self.opts.relativepath groupid = self.opts.groupid cert_data = self._get_cert_options() keylist = se... | 454,085 |
def run(self): id = self.get_required_option('id') name = self.opts.name or id arch = self.opts.arch or 'noarch' feed = self.opts.feed symlinks = self.opts.symlinks or False schedule = self.opts.schedule relative_path = self.opts.relativepath groupid = self.opts.groupid cert_data = self._get_cert_options() keylist = se... | def run(self): id = self.get_required_option('id') name = self.opts.name or id arch = self.opts.arch or 'noarch' feed = self.opts.feed symlinks = self.opts.symlinks or False schedule = self.opts.schedule relative_path = self.opts.relativepath groupid = self.opts.groupid cert_data = self._get_cert_options() keylist = se... | 454,086 |
def setup_parser(self): super(Clone, self).setup_parser() self.parser.add_option("--clone_id", dest="clone_id", help=_("id of cloned repo")) self.parser.add_option("--clone_name", dest="clone_name", help=_("common repository name for cloned repo")) self.parser.add_option("--feed", dest="feed", help=_("feed of cloned_re... | def setup_parser(self): super(Clone, self).setup_parser() self.parser.add_option("--clone_id", dest="clone_id", help=_("id of cloned repo")) self.parser.add_option("--clone_name", dest="clone_name", help=_("common repository name for cloned repo")) self.parser.add_option("--feed", dest="feed", help=_("feed of cloned_re... | 454,087 |
def get_task(self): id = self.get_required_option('id') tasks = self.pconn.sync_list(id) if tasks and tasks[0]['state'] in ('waiting', 'running'): print _('Sync for parent repository %s already in progress') % id return tasks[0] clone_id = self.opts.clone_id clone_name = self.opts.clone_name or clone_id feed = self.opt... | def get_task(self): id = self.get_required_option('id') tasks = self.pconn.sync_list(id) if tasks and tasks[0]['state'] in ('waiting', 'running'): print _('Sync for parent repository %s already in progress') % id return tasks[0] clone_id = self.opts.clone_id clone_name = self.opts.clone_name or clone_id feed = self.opt... | 454,088 |
def run(self): foreground = self.opts.foreground task = self.get_task() if not foreground: system_exit(os.EX_OK, _('Use "repo status" to check on the progress')) self.clone_foreground(task) | def run(self): foreground = self.opts.foreground task = self.get_task() if not foreground: system_exit(os.EX_OK, _('Use "repo status" to check on the progress')) self.clone_foreground(task) | 454,089 |
def run(self): id = self.get_required_option('id') repo = self.pconn.repository(id) if not repo: system_exit(os.EX_DATAERR, _("Repository with id: [%s] not found") % id) optdict = vars(self.opts) for k, v in optdict.items(): if not v: continue method = self.find(k) if method: # special method stale = method(repo, v) if... | def run(self): id = self.get_required_option('id') repo = self.get_repo(id) optdict = vars(self.opts) for k, v in optdict.items(): if not v: continue method = self.find(k) if method: # special method stale = method(repo, v) if stale: repo = self.pconn.repository(id) continue if k in repo: repo[k] = v self.pconn.update(... | 454,090 |
def run(self): id = self.get_required_option('id') files = self.args dir = self.opts.dir if dir: try: files += utils.processDirectory(dir, "rpm") except Exception, e: system_exit(os.EX_DATAERR, _(str(e))) if not files: system_exit(os.EX_USAGE, _("Need to provide at least one file to perform upload")) uploadinfo = {} up... | def run(self): id = self.get_required_option('id') files = self.args dir = self.opts.dir if dir: try: files += utils.processDirectory(dir, "rpm") except Exception, e: system_exit(os.EX_DATAERR, _(str(e))) if not files: system_exit(os.EX_USAGE, _("Need to provide at least one file to perform upload")) uploadinfo = {} up... | 454,091 |
def run(self): id = self.get_required_option('id') for key in self.pconn.listkeys(id): print os.path.basename(key) | def run(self): id = self.get_required_option('id') for key in self.pconn.listkeys(id): print os.path.basename(key) | 454,092 |
def setup_parser(self): super(Publish, self).setup_parser() self.parser.add_option("--disable", dest="disable", action="store_true", default=False, help=_("disable publish for this repository")) self.parser.add_option("--enable", dest="enable", action="store_true", default=False, help=_("enable publish for this reposit... | def setup_parser(self): super(Publish, self).setup_parser() self.parser.add_option("--disable", dest="disable", action="store_true", default=False, help=_("disable publish for this repository")) self.parser.add_option("--enable", dest="enable", action="store_true", default=False, help=_("enable publish for this reposit... | 454,093 |
def setup_parser(self): super(Publish, self).setup_parser() self.parser.add_option("--disable", dest="disable", action="store_true", default=False, help=_("disable publish for this repository")) self.parser.add_option("--enable", dest="enable", action="store_true", default=False, help=_("enable publish for this reposit... | def setup_parser(self): super(Publish, self).setup_parser() self.parser.add_option("--disable", dest="disable", action="store_true", default=False, help=_("disable publish for this repository")) self.parser.add_option("--enable", dest="enable", action="store_true", default=False, help=_("enable publish for this reposit... | 454,094 |
def create(self, id, name, arch, feed=None, symlinks=False, sync_schedule=None, cert_data=None, groupid=None, relative_path=None): """ Create a new Repository object and return it """ repo = self.repository(id) if repo is not None: raise PulpException("A Repo with id %s already exists" % id) self._validate_schedule(syn... | def create(self, id, name, arch, feed=None, symlinks=False, sync_schedule=None, cert_data=None, groupid=None, relative_path=None): """ Create a new Repository object and return it """ repo = self.repository(id) if repo is not None: raise PulpException("A Repo with id %s already exists" % id) self._validate_schedule(syn... | 454,095 |
def delete(self, id): repo = self._get_existing_repo(id) repo_sync.delete_schedule(repo) repo_location = "%s/%s" % (config.config.get('paths', 'local_storage'), "repos") #delete any data associated to this repo for field in ['relative_path', 'cert', 'key', 'ca']: if field == 'relative_path' and repo[field]: fpath = os.... | def delete(self, id): repo = self._get_existing_repo(id) repo_sync.delete_schedule(repo) repo_location = "%s/%s" % (config.config.get('paths', 'local_storage'), "repos") #delete any data associated to this repo for field in ['relative_path', 'cert', 'key', 'ca']: if field == 'relative_path' and repo[field]: fpath = os.... | 454,096 |
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 | 454,097 |
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 | 454,098 |
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... | 454,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.