Source files: 340
Click here to show/hide file namesSource files:
./setup.py,
./compile.py,
./db-checker.py,
./_apache.py,
./server/basePackageUpload.py,
./server/rhnServerGroup.py,
./server/rhnCapability.py,
./server/rhnPackageUpload.py,
./server/apacheHandler.py,
./server/apacheRequest.py,
./server/rhnRepository.py,
./server/rhnChannel.py,
./server/rhnPackage.py,
./server/apacheUploadServer.py,
./server/__init__.py,
./server/rhnImport.py,
./server/rhnKickstart.py,
./server/rhnMapping.py,
./server/rhnSession.py,
./server/rhnUser.py,
./server/rhnAuthPAM.py,
./server/rhnLib.py,
./server/rhnDependency.py,
./server/taskomatic.py,
./server/rhnActivationKey.py,
./server/rhnDatabaseCache.py,
./server/apacheAuth.py,
./server/rhnHandler.py,
./server/configFilesHandler.py,
./server/apacheServer.py,
./server/rhnVirtualization.py,
./server/rhnAction.py,
./server/rhnServer/server_certificate.py,
./server/rhnServer/server_kickstart.py,
./server/rhnServer/server_class.py,
./server/rhnServer/search_notify.py,
./server/rhnServer/server_hardware.py,
./server/rhnServer/satellite_cert.py,
./server/rhnServer/__init__.py,
./server/rhnServer/server_solarispatches.py,
./server/rhnServer/server_token.py,
./server/rhnServer/server_wrapper.py,
./server/rhnServer/server_route.py,
./server/rhnServer/server_lib.py,
./server/rhnServer/server_packages.py,
./server/rhnServer/server_history.py,
./server/importlib/kickstartImport.py,
./server/importlib/archImport.py,
./server/importlib/errataImport.py,
./server/importlib/errataCache.py,
./server/importlib/productNamesImport.py,
./server/importlib/mpmSource.py,
./server/importlib/debPackage.py,
./server/importlib/backendLib.py,
./server/importlib/__init__.py,
./server/importlib/packageImport.py,
./server/importlib/backend.py,
./server/importlib/channelImport.py,
./server/importlib/importLib.py,
./server/importlib/headerSource.py,
./server/importlib/backendOracle.py,
./server/importlib/blacklistImport.py,
./server/importlib/packageUpload.py,
./server/importlib/userAuth.py,
./server/importlib/test/test_blob_update.py,
./server/importlib/test/test_ks_tree.py,
./server/importlib/test/test_strict_channel_package_subscription.py,
./server/importlib/test/test_backendOracle.py,
./server/importlib/test/test_solaris.py,
./server/rhnSQL/sql_sequence.py,
./server/rhnSQL/sql_lib.py,
./server/rhnSQL/sql_types.py,
./server/rhnSQL/dbi.py,
./server/rhnSQL/sql_row.py,
./server/rhnSQL/const.py,
./server/rhnSQL/__init__.py,
./server/rhnSQL/driver_postgresql.py,
./server/rhnSQL/sql_table.py,
./server/rhnSQL/sql_base.py,
./server/rhnSQL/driver_cx_Oracle.py,
./server/action_extra_data/reboot.py,
./server/action_extra_data/rhn_applet.py,
./server/action_extra_data/kickstart_host.py,
./server/action_extra_data/script.py,
./server/action_extra_data/errata.py,
./server/action_extra_data/kickstart_guest.py,
./server/action_extra_data/packages.py,
./server/action_extra_data/hardware.py,
./server/action_extra_data/rollback.py,
./server/action_extra_data/up2date_config.py,
./server/action_extra_data/__init__.py,
./server/action_extra_data/kickstart.py,
./server/action_extra_data/virt.py,
./server/action_extra_data/rhnsd.py,
./server/action_extra_data/configfiles.py,
./server/action_extra_data/solarispkgs.py,
./server/repomd/domain.py,
./server/repomd/repository.py,
./server/repomd/view.py,
./server/repomd/__init__.py,
./server/repomd/mapper.py,
./server/handlers/__init__.py,
./server/handlers/xp/rhnlint.py,
./server/handlers/xp/packages.py,
./server/handlers/xp/__init__.py,
./server/handlers/config/__init__.py,
./server/handlers/config/rhn_config_management.py,
./server/handlers/config/test/test_template1.py,
./server/handlers/app/comps.py,
./server/handlers/app/packages.py,
./server/handlers/app/__init__.py,
./server/handlers/app/channel.py,
./server/handlers/app/rhn_mpm.py,
./server/handlers/app/test/test_channel.py,
./server/handlers/sat/get_handler.py,
./server/handlers/sat/auth.py,
./server/handlers/sat/cert.py,
./server/handlers/sat/__init__.py,
./server/handlers/config_mgmt/__init__.py,
./server/handlers/config_mgmt/rhn_config_management.py,
./server/handlers/applet/__init__.py,
./server/handlers/applet/applet.py,
./server/handlers/xmlrpc/get_handler.py,
./server/handlers/xmlrpc/proxy.py,
./server/handlers/xmlrpc/errata.py,
./server/handlers/xmlrpc/queue.py,
./server/handlers/xmlrpc/up2date.py,
./server/handlers/xmlrpc/registration.py,
./server/handlers/xmlrpc/getMethod.py,
./server/handlers/xmlrpc/__init__.py,
./server/handlers/xmlrpc/country.py,
./server/handlers/xmlrpc/states.py,
./server/config_common/base_templated_document.py,
./server/config_common/templated_document.py,
./server/config_common/__init__.py,
./server/action/reboot.py,
./server/action/rhn_applet.py,
./server/action/kickstart_host.py,
./server/action/script.py,
./server/action/errata.py,
./server/action/kickstart_guest.py,
./server/action/utils.py,
./server/action/packages.py,
./server/action/hardware.py,
./server/action/rollback.py,
./server/action/activation.py,
./server/action/__init__.py,
./server/action/kickstart.py,
./server/action/virt.py,
./server/action/rhnsd.py,
./server/action/configfiles.py,
./server/action/solarispkgs.py,
./server/test/test_dcoracle2.py,
./server/test/test_procedures.py,
./server/test/test-cx_Oracle-memleak.py,
./server/test/test_errata_import_webqa.py,
./server/test/test_rhnCapability.py,
./server/test/test_solve_dependencies.py,
./server/test/test_next_action.py,
./server/test/test_applet.py,
./server/test/test_leak2.py,
./server/test/test_rhnChannel.py,
./server/test/test_malformed_xml.py,
./server/test/test_CFG.py,
./server/test/misc_functions.py,
./server/test/test-rhn-import.py,
./server/test/test_applet_as.py,
./server/test/test_action_rpm_verify_extra_data.py,
./server/test/test_upload_imports.py,
./server/test/test_rhnSQL_Procedure.py,
./server/test/test-add-download-2.py,
./server/test/test_delta_computation.py,
./server/test/test_rhnDatabaseCache.py,
./server/test/TestProxy.py,
./server/test/test_make_evr.py,
./server/test/test_leak4.py,
./server/test/test_action_rhnsd_config.py,
./server/test/test_action_solarispkg_extra_data.py,
./server/test/test_xmlrpc_up2date.py,
./server/test/test_registration.py,
./server/test/TestRedhat.py,
./server/test/byterangetests.py,
./server/test/test_queue_get.py,
./server/test/test_leak3.py,
./server/test/test_rhnSession.py,
./server/test/TestRhnpush.py,
./server/test/test_caps_display.py,
./server/test/test_mem_satellite_cert.py,
./server/test/test_test_login.py,
./server/test/test_censored_db_password.py,
./server/test/test_leak.py,
./server/test/test_list_missing_source_packages.py,
./server/test/TestServer.py,
./server/test/test_satellite_cert.py,
./server/test/test_message.py,
./server/test/unit-test/cx_create_table.py,
./server/test/unit-test/test_misc_functions.py,
./server/test/unit-test/test_rhnChannel.py,
./server/test/unit-test/misc_functions.py,
./server/test/unit-test/test_rhnServerGroup.py,
./server/test/unit-test/test_rhnDatabaseCache.py,
./server/test/unit-test/test_capabilities.py,
./server/test/unit-test/test_rhnActivationKey.py,
./server/test/unit-test/test_rhnLib_timestamp.py,
./server/test/unit-test/test_server_registration.py,
./server/test/unit-test/rhnSQL/test_1.py,
./server/test/unit-test/rhnSQL/test_executemany.py,
./server/test/unit-test/rhnSQL/test_2.py,
./server/test/unit-test/rhnSQL/test_lob.py,
./common/rhnCache.py,
./common/rhnTB.py,
./common/rhnException.py,
./common/rhnRepository.py,
./common/rhn_timer.py,
./common/UserDictCase.py,
./common/apache.py,
./common/rhnLog.py,
./common/__init__.py,
./common/byterange.py,
./common/rhnLib.py,
./common/rhn_memusage.py,
./common/RPC_Base.py,
./common/rhn_posix.py,
./common/rhnMail.py,
./common/rhnConfig.py,
./common/rhnTranslate.py,
./common/rhnFlags.py,
./common/rhnApache.py,
./common/test/unit-test/test_rhnLib.py,
./common/test/unit-test/test_rhnCache.py,
./common/test/unit-test/test_gettext.py,
./satellite_tools/xmlDiskDumper.py,
./satellite_tools/sync_handlers.py,
./satellite_tools/connection.py,
./satellite_tools/constants.py,
./satellite_tools/rhn_ssl_dbstore.py,
./satellite_tools/xmlDiskSource.py,
./satellite_tools/xmlWireSource.py,
./satellite_tools/gentree.py,
./satellite_tools/geniso.py,
./satellite_tools/xmlSource.py,
./satellite_tools/rhn_satellite_activate.py,
./satellite_tools/satsync.py,
./satellite_tools/updatePackages.py,
./satellite_tools/satCerts.py,
./satellite_tools/req_channels.py,
./satellite_tools/__init__.py,
./satellite_tools/SequenceServer.py,
./satellite_tools/syncLib.py,
./satellite_tools/reposync.py,
./satellite_tools/satComputePkgHeaders.py,
./satellite_tools/progress_bar.py,
./satellite_tools/syncCache.py,
./satellite_tools/diskImportLib.py,
./satellite_tools/messages.py,
./satellite_tools/exporter/xmlWriter.py,
./satellite_tools/exporter/__init__.py,
./satellite_tools/exporter/exporter.py,
./satellite_tools/exporter/exportLib.py,
./satellite_tools/disk_dumper/dumper.py,
./satellite_tools/disk_dumper/iss_isos.py,
./satellite_tools/disk_dumper/iss_ui.py,
./satellite_tools/disk_dumper/__init__.py,
./satellite_tools/disk_dumper/iss.py,
./satellite_tools/disk_dumper/string_buffer.py,
./satellite_tools/disk_dumper/iss_actions.py,
./satellite_tools/repo_plugins/__init__.py,
./satellite_tools/repo_plugins/yum_src.py,
./satellite_tools/test/test-dump-channel.py,
./satellite_tools/test/test-satsync-errata.py,
./satellite_tools/test/testerror.py,
./satellite_tools/test/test-raw-download.py,
./satellite_tools/test/testgzipstream.py,
./satellite_tools/test/test-iconv.py,
./satellite_tools/test/test-dump-ks.py,
./satellite_tools/test/test-dump-arches.py,
./satellite_tools/test/test-pkg-download.py,
./satellite_tools/test/test-import-kstree.py,
./satellite_tools/test/test-ks-file-download.py,
./satellite_tools/test/test-store_rhnCryptoKey.py,
./satellite_tools/test/test-cert-download.py,
./satellite_tools/test/test-errata-import.py,
./satellite_tools/test/testxmlrpc.py,
./satellite_tools/test/testsync.py,
./satellite_tools/test/testxmlwriter.py,
./satellite_tools/test/testxmlparser.py,
./satellite_tools/test/test-download.py,
./satellite_tools/test/test-import-rhn-cert.py,
./satellite_tools/test/test-errata.py,
./satellite_tools/test/testlibxml2parser.py,
./satellite_tools/test/testnew.py,
./satellite_tools/test/test-internal.py,
./satellite_tools/test/test-gzip-pipe.py,
./satellite_exporter/satexport.py,
./satellite_exporter/__init__.py,
./satellite_exporter/handlers/__init__.py,
./satellite_exporter/handlers/non_auth_dumper.py,
./wsgi/config_tool.py,
./wsgi/config.py,
./wsgi/sat.py,
./wsgi/package_upload.py,
./wsgi/wsgiRequest.py,
./wsgi/xp.py,
./wsgi/sat_dump.py,
./wsgi/__init__.py,
./wsgi/wsgiHandler.py,
./wsgi/xmlrpc.py,
./wsgi/package_push.py,
./wsgi/applet.py,
./wsgi/app.py,
./po/pygettext.py,
./upload_server/__init__.py,
./upload_server/handlers/__init__.py,
./upload_server/handlers/package_push/__init__.py,
./upload_server/handlers/package_push/package_push.py,
./upload_server/handlers/package_upload/package_upload.py,
./upload_server/handlers/package_upload/__init__.py,
./test/runtests.py,
./test/test_cache.py,
./test/runtests-oracle.py,
./test/runtests-postgresql.py,
./test/johntest.py,
./test/unit/spacewalk/__init__.py,
./test/unit/spacewalk/test/setpath.py,
./test/unit/spacewalk/test/__init__.py,
./test/unit/spacewalk/test/server/rhnsql-tests.py,
./test/unit/spacewalk/test/server/__init__.py,
./test/unit/spacewalk/test/common/__init__.py,
./test/unit/spacewalk/test/common/rhnLib-tests.py,
./test/non-unit/server/__init__.py,
./test/non-unit/server/rhnSQL/__init__.py,
./test/non-unit/server/rhnSQL/dbtests.py,
./test/reactivation/reactivationTest.py,
./spacewalk/__init__.py,
./spacewalk/common/rhn_rpm.py,
./spacewalk/common/checksum.py,
./spacewalk/common/fileutils.py,
./spacewalk/common/__init__.py,
./spacewalk/common/rhn_mpm.py,
./spacewalk/common/rhn_deb.py
Clones detected: 1392
6751 of 37417 lines are duplicates (18.04%)
Parameters
clustering_threshold = 10
distance_threshold = 5
size_threshold = 5
hashing_depth = 1
clusterize_using_hash = False
clusterize_using_dcup = False
Clone # 1
Distance between two fragments = 0
Clone size = 81
Source file "./spacewalk/common/rhn_mpm.py" The first line is 176 | Source file "./server/handlers/app/rhn_mpm.py" The first line is 153 | |
def _read_bytes(self, stream, amt): ret = '' while amt: buf = stream.read(min(amt, self._buffer_size)) if not buf: return ret ret = (ret) + (buf) amt = (amt) - (len(buf)) return ret |
def _read_bytes(self, stream, amt): ret = '' while amt: buf = stream.read(min(amt, self._buffer_size)) if not buf: return ret ret = (ret) + (buf) amt = (amt) - (len(buf)) return ret |
|
def _read_header(self, header_data, header_flags): if (header_flags) & (MPM_HEADER_COMPRESSED_GZIP): t = cStringIO.StringIO(header_data) g = gzip.GzipFile(None, 'r', 0, t) header_data = g.read() g.close() t.close() try: params, foo = xmlrpclib.loads(header_data) except: raise self.header = MPM_Header(params[0]) |
def _read_header(self, header_data, header_flags): if (header_flags) & (MPM_HEADER_COMPRESSED_GZIP): t = cStringIO.StringIO(header_data) g = gzip.GzipFile(None, 'r', 0, t) header_data = g.read() g.close() t.close() try: params, foo = xmlrpclib.loads(header_data) except: raise self.header = MPM_Header(params[0]) |
|
def _read_payload(self, payload_stream, payload_flags): payload_stream.seek(0, 0) if (payload_flags) & (MPM_PAYLOAD_COMPRESSED_GZIP): g = gzip.GzipFile(None, 'r', 0, payload_stream) t = tempfile.TemporaryFile() self.stream_copy(g, t) g.close() payload_stream = t self.payload_stream = payload_stream |
def _read_payload(self, payload_stream, payload_flags): payload_stream.seek(0, 0) if (payload_flags) & (MPM_PAYLOAD_COMPRESSED_GZIP): g = gzip.GzipFile(None, 'r', 0, payload_stream) t = tempfile.TemporaryFile() self.stream_copy(g, t) g.close() payload_stream = t self.payload_stream = payload_stream |
|
def write(self, output_stream): if self.header is None: raise Exception() header_stream, header_size = self._encode_header() payload_stream, payload_size = self._encode_payload() lead_arr = (self._magic, 1, ('\x00') * (3), self.header_flags, self.payload_flags, header_size, payload_size, ('\x00') * (92)) lead = apply(struct.pack, ((self._lead_format)) + (lead_arr)) output_stream.write(lead) self.stream_copy(header_stream, output_stream) self.stream_copy(payload_stream, output_stream) |
def write(self, output_stream): if self.header is None: raise Exception() header_stream, header_size = self._encode_header() payload_stream, payload_size = self._encode_payload() lead_arr = (self._magic, 1, ('\x00') * (3), self.header_flags, self.payload_flags, header_size, payload_size, ('\x00') * (92)) lead = apply(struct.pack, ((self._lead_format)) + (lead_arr)) output_stream.write(lead) self.stream_copy(header_stream, output_stream) self.stream_copy(payload_stream, output_stream) |
|
def add_header_flag(self, flag): self.header_flags = (self.header_flags) | (flag) |
def add_header_flag(self, flag): self.header_flags = (self.header_flags) | (flag) |
|
def add_payload_flag(self, flag): self.payload_flags = (self.payload_flags) | (flag) |
def add_payload_flag(self, flag): self.payload_flags = (self.payload_flags) | (flag) |
|
def reset_header_flags(self): self.header_flags = 0 |
def reset_header_flags(self): self.header_flags = 0 |
|
def reset_payload_flags(self): self.payload_flags = 0 |
def reset_payload_flags(self): self.payload_flags = 0 |
|
def _encode_header(self): assert self.header is not None stream = tempfile.TemporaryFile() data = xmlrpclib.dumps((_replace_null(self.header))) if (self.header_flags) & (MPM_HEADER_COMPRESSED_GZIP): f = gzip.GzipFile(None, 'wb', 9, stream) f.write(data) f.close() else: stream.write(data) stream.flush() stream.seek(0, 2) size = stream.tell() stream.seek(0, 0) return (stream, size) |
def _encode_header(self): assert self.header is not None stream = tempfile.TemporaryFile() data = xmlrpclib.dumps((_replace_null(self.header))) if (self.header_flags) & (MPM_HEADER_COMPRESSED_GZIP): f = gzip.GzipFile(None, 'wb', 9, stream) f.write(data) f.close() else: stream.write(data) stream.flush() stream.seek(0, 2) size = stream.tell() stream.seek(0, 0) return (stream, size) |
|
def _encode_payload(self): assert self.payload_stream is not None stream = tempfile.TemporaryFile() if (self.payload_flags) & (MPM_PAYLOAD_COMPRESSED_GZIP): f = gzip.GzipFile(None, 'wb', 9, stream) self.stream_copy(self.payload_stream, f) f.close() else: stream = self.payload_stream stream.flush() stream.seek(0, 2) size = stream.tell() stream.seek(0, 0) return (stream, size) |
def _encode_payload(self): assert self.payload_stream is not None stream = tempfile.TemporaryFile() if (self.payload_flags) & (MPM_PAYLOAD_COMPRESSED_GZIP): f = gzip.GzipFile(None, 'wb', 9, stream) self.stream_copy(self.payload_stream, f) f.close() else: stream = self.payload_stream stream.flush() stream.seek(0, 2) size = stream.tell() stream.seek(0, 0) return (stream, size) |
|
def stream_copy(self, source, dest): while 1: buf = source.read(self._buffer_size) if not buf: break dest.write(buf) |
def stream_copy(self, source, dest): while 1: buf = source.read(self._buffer_size) if not buf: break dest.write(buf) |
Clone # 2
Distance between two fragments = 4
Clone size = 78
Source file "./server/test/unit-test/misc_functions.py" The first line is 25 | Source file "./server/test/misc_functions.py" The first line is 48 | |
def create_new_org(): org_name = ('unittest-org-%.3f') % (time.time()) org_password = ('unittest-password-%.3f') % (time.time()) org_id = rhnServerGroup.create_new_org(org_name, org_password) rhnSQL.commit() return org_id |
def create_new_org(): org_name = ('unittest-org-%.3f') % (time.time()) org_password = ('unittest-password-%.3f') % (time.time()) org_id = rhnServerGroup.create_new_org(org_name, org_password) rhnSQL.commit() return (org_id, org_name, org_password) |
|
def _create_server_group(org_id, name, description, max_members): s = rhnServerGroup.ServerGroup() s.set_org_id(org_id) s.set_name(name) s.set_description(description) s.set_max_members(max_members) s.save() rhnSQL.commit() return s |
def _create_server_group(org_id, name, description, max_members): s = rhnServerGroup.ServerGroup() s.set_org_id(org_id) s.set_name(name) s.set_description(description) s.set_max_members(max_members) s.save() rhnSQL.commit() return s |
|
def create_server_group(params): return apply(_create_server_group, (), params) |
def create_server_group(params): return apply(_create_server_group, (), params) |
|
def fetch_server_group(org_id, name): s = rhnServerGroup.ServerGroup() s.load(org_id, name) return s |
def fetch_server_group(org_id, name): s = rhnServerGroup.ServerGroup() s.load(org_id, name) return s |
|
_query_fetch_server_groups = rhnSQL.Statement('\n select sgm.server_group_id\n from rhnServerGroupMembers sgm,\n rhnServerGroup sg\n where sgm.server_id = :server_id\n and sgm.server_group_id = sg.id\n and sg.group_type is null\n') | _query_fetch_server_groups = rhnSQL.Statement('\n select sgm.server_group_id\n from rhnServerGroupMembers sgm,\n rhnServerGroup sg\n where sgm.server_id = :server_id\n and sgm.server_group_id = sg.id\n and sg.group_type is null\n') | |
def fetch_server_groups(server_id): h = rhnSQL.prepare(_query_fetch_server_groups) h.execute(server_id=server_id) groups = map(lambda x: x['server_group_id'], (h.fetchall_dict()) or ([])) groups.sort() return groups |
def fetch_server_groups(server_id): h = rhnSQL.prepare(_query_fetch_server_groups) h.execute(server_id=server_id) groups = map(lambda x: x['server_group_id'], (h.fetchall_dict()) or ([])) groups.sort() return groups |
|
def build_server_group_params(**kwargs): params = {'org_id': 'no such org', 'name': ('unittest group name %.3f') % (time.time()), 'description': ('unittest group description %.3f') % (time.time()), 'max_members': 1001} params.update(kwargs) return params |
def build_server_group_params(**kwargs): params = {'org_id': 'no such org', 'name': ('unittest group name %.3f') % (time.time()), 'description': ('unittest group description %.3f') % (time.time()), 'max_members': 1001} params.update(kwargs) return params |
|
def create_new_user(org_id=None, username=None, password=None, roles=None): if org_id is None: org_id = create_new_org() else: org_id = lookup_org_id(org_id) if username is None: username = ('unittest-user-%.3f') % (time.time()) if password is None: password = ('unittest-password-%.3f') % (time.time()) if roles is None: roles = [] u = rhnUser.User(username, password) u.set_org_id(org_id) u.save() u.contact['password'] = password u.save() user_id = u.getid() h = rhnSQL.prepare('\n select ug.id\n from rhnUserGroupType ugt, rhnUserGroup ug\n where ug.org_id = :org_id\n and ug.group_type = ugt.id\n and ugt.label = :role\n ') create_ugm = rhnSQL.Procedure('rhn_user.add_to_usergroup') for role in roles: h.execute(org_id=org_id, role=role) row = h.fetchone_dict() if not row: raise InvalidRoleError(org_id, role) user_group_id = row['id'] create_ugm(user_id, user_group_id) rhnSQL.commit() return u |
def create_new_user(org_id=None, username=None, password=None, roles=None): if org_id is None: org_id = create_new_org() else: org_id = lookup_org_id(org_id) if username is None: username = ('unittest-user-%.3f') % (time.time()) if password is None: password = ('unittest-password-%.3f') % (time.time()) if roles is None: roles = [] u = rhnUser.User(username, password) u.set_org_id(org_id) u.save() u.contact['password'] = password u.save() user_id = u.getid() h = rhnSQL.prepare('\n select ug.id\n from rhnUserGroupType ugt, rhnUserGroup ug\n where ug.org_id = :org_id\n and ug.group_type = ugt.id\n and ugt.label = :role\n ') create_ugm = rhnSQL.Procedure('rhn_user.add_to_usergroup') for role in roles: h.execute(org_id=org_id, role=role) row = h.fetchone_dict() if not row: raise InvalidRoleError(org_id, role) user_group_id = row['id'] create_ugm(user_id, user_group_id) rhnSQL.commit() return u |
|
def lookup_org_id(org_id): if isinstance(org_id, types.StringType): u = rhnUser.search(org_id) if not u: raise rhnServerGroup.InvalidUserError(org_id) return u.contact['org_id'] t = rhnSQL.Table('web_customer', 'id') row = t[org_id] if not row: raise rhnServerGroup.InvalidOrgError(org_id) return row['id'] |
def lookup_org_id(org_id): if isinstance(org_id, types.StringType): u = rhnUser.search(org_id) if not u: raise rhnServerGroup.InvalidUserError(org_id) return u.contact['org_id'] t = rhnSQL.Table('web_customer', 'id') row = t[org_id] if not row: raise rhnServerGroup.InvalidOrgError(org_id) return row['id'] |
|
class InvalidEntitlementError(Exception): pass |
class InvalidRoleError(Exception): pass |
Clone # 3
Distance between two fragments = 0
Clone size = 35
Source file "./server/test/unit-test/misc_functions.py" The first line is 150 | Source file "./server/test/misc_functions.py" The first line is 349 | |
def create_activation_key(org_id=None, user_id=None, groups=None, channels=None, entitlement_level=None, note=None, server_id=None): if org_id is None: need_user = 1 org_id = create_new_org() else: need_user = 0 if user_id is None: if need_user: u = create_new_user(org_id=org_id) user_id = u.getid() else: u = rhnUser.User('', '') u.reload(user_id) if groups is None: groups = [] for i in range(3): params = build_server_group_params(org_id=org_id) sg = create_server_group(params) groups.append(sg.get_id()) if channels is None: channels = ['rhel-i386-as-3-beta', 'rhel-i386-as-2.1-beta'] if entitlement_level is None: entitlement_level = 'provisioning_entitled' if note is None: note = ('Test activation key %d') % (int(time.time())) a = rhnActivationKey.ActivationKey() a.set_user_id(user_id) a.set_org_id(org_id) a.set_entitlement_level(entitlement_level) a.set_note(note) a.set_server_groups(groups) a.set_channels(channels) a.set_server_id(server_id) a.save() rhnSQL.commit() return a |
def create_activation_key(org_id=None, user_id=None, groups=None, channels=None, entitlement_level=None, note=None, server_id=None): if org_id is None: need_user = 1 org_id = create_new_org() else: need_user = 0 if user_id is None: if need_user: u = create_new_user(org_id=org_id) user_id = u.getid() else: u = rhnUser.User('', '') u.reload(user_id) if groups is None: groups = [] for i in range(3): params = build_server_group_params(org_id=org_id) sg = create_server_group(params) groups.append(sg.get_id()) if channels is None: channels = ['rhel-i386-as-3-beta', 'rhel-i386-as-2.1-beta'] if entitlement_level is None: entitlement_level = 'provisioning_entitled' if note is None: note = ('Test activation key %d') % (int(time.time())) a = rhnActivationKey.ActivationKey() a.set_user_id(user_id) a.set_org_id(org_id) a.set_entitlement_level(entitlement_level) a.set_note(note) a.set_server_groups(groups) a.set_channels(channels) a.set_server_id(server_id) a.save() rhnSQL.commit() return a |
Clone # 4
Distance between two fragments = 4
Clone size = 33
Source file "./server/test/test_solve_dependencies.py" The first line is 378 | Source file "./server/test/test_solve_dependencies.py" The first line is 317 | |
def testUp2dateFilterGTE1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
def testUp2dateFilterGTE(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
|
def testUp2dateFilterLT1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterLT(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
|
def testUp2dateFilterLTE1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
def testUp2dateFilterLTE(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
Clone # 5
Distance between two fragments = 3
Clone size = 26
Source file "./satellite_tools/satsync.py" The first line is 1279 | Source file "./satellite_tools/satsync.py" The first line is 1103 | |
for channel, pids in missing_packages.items(): package_count = len(pids) log(1, (messages.package_parsing) % ((channel, (package_count) or ('NONE RELEVANT')))) if not package_count: continue log(1, ' * WARNING: this may be a very slow process.') pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) if CFG.DEBUG > 2: pb.redrawYN = 0 pb.printAll(1) ss = SequenceServer(pids[:], nevermorethan=self._batch_size) while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() pb.printComplete() |
for channel, pids in missing_packages.items(): package_count = len(pids) log(1, (messages.package_parsing) % ((channel, (package_count) or ('NONE RELEVANT')))) if not package_count: continue log(1, messages.warning_slow) pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) if CFG.DEBUG > 2: pb.redrawYN = 0 pb.printAll(1) ss = SequenceServer(pids[:], nevermorethan=self._batch_size) while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() pb.printComplete() |
|
h.close() | h.close() | |
missing_packages = self._compute_not_cached_source_packages() | missing_packages = self._missing_not_cached_packages() | |
for channel, pids in missing_packages.items(): if pids: raise ReprocessingNeeded |
for channel, pids in missing_packages.items(): if pids: raise ReprocessingNeeded |
Clone # 6
Distance between two fragments = 4
Clone size = 26
Source file "./server/importlib/channelImport.py" The first line is 345 | Source file "./server/importlib/channelImport.py" The first line is 304 | |
def preprocess(self): for rcm in self.batch: self.arches[rcm['arch']] = None self.channels[rcm['channel']] = None |
def preprocess(self): for dcm in self.batch: self.arches[dcm['arch']] = None self.channels[dcm['channel']] = None |
|
def fix(self): self.backend.lookupChannelArches(self.arches) self.backend.lookupChannels(self.channels) for dcm in self.batch: arch = self.arches[rcm['arch']] if arch is None: rcm.ignored = 1 raise InvalidArchError(rcm['arch'], ('Invalid release_channel_map arch %s') % (rcm['arch'])) channel = self.channels[rcm['channel']] if channel is None: rcm.ignored = 1 raise InvalidChannelError(rcm['channel'], ('Invalid release_channel_map channel %s') % (rcm['channel'])) rcm['arch'] = arch rcm['channel_id'] = channel['id'] |
def fix(self): self.backend.lookupChannelArches(self.arches) self.backend.lookupChannels(self.channels) for dcm in self.batch: arch = self.arches[dcm['arch']] if arch is None: dcm.ignored = 1 raise InvalidArchError(dcm['arch'], ('Invalid dist_channel_map arch %s') % (dcm['arch'])) channel = self.channels[dcm['channel']] if channel is None: dcm.ignored = 1 raise InvalidChannelError(dcm['channel'], ('Invalid dist_channel_map channel %s') % (dcm['channel'])) dcm['arch'] = arch dcm['channel_id'] = channel['id'] |
|
def submit(self): try: self.backend.processReleaseChannelMap(self.batch) except: self.backend.rollback() raise self.backend.commit() |
def submit(self): try: self.backend.processDistChannelMap(self.batch) except: self.backend.rollback() raise self.backend.commit() |
Clone # 7
Distance between two fragments = 2
Clone size = 24
Source file "./server/handlers/app/packages.py" The first line is 521 | Source file "./server/handlers/app/packages.py" The first line is 357 | |
if (pkg_info.has_key('checksum')) and (CFG.ENABLE_NVREA): checksum_exists = 1 _checksum_sql_filter = 'and c.checksum = :checksum\n and c.checksum_type = :checksum_type' |
if (package.has_key('checksum')) and (CFG.ENABLE_NVREA): checksum_exists = 1 _checksum_sql_filter = 'and c.checksum = :checksum\n and c.checksum_type = :checksum_type' |
|
h = rhnSQL.prepare((self._get_pkg_info_query) % (_checksum_sql_filter)) | h = rhnSQL.prepare((self._get_pkg_info_query) % (_checksum_sql_filter)) | |
pkg_epoch = None | pkg_epoch = None | |
if pkg_info['epoch'] != '': pkg_epoch = pkg_info['epoch'] |
if package['epoch'] != '': pkg_epoch = package['epoch'] |
|
if checksum_exists: h.execute(pkg_name=pkg_info['name'], pkg_epoch=pkg_epoch, pkg_version=pkg_info['version'], pkg_rel=pkg_info['release'], pkg_arch=pkg_info['arch'], orgid=org_id, checksum_type=pkg_info['checksum_type'], checksum=pkg_info['checksum']) else: h.execute(pkg_name=pkg_info['name'], pkg_epoch=pkg_epoch, pkg_version=pkg_info['version'], pkg_rel=pkg_info['release'], pkg_arch=pkg_info['arch'], orgid=org_id) |
if checksum_exists: h.execute(pkg_name=package['name'], pkg_epoch=pkg_epoch, pkg_version=package['version'], pkg_rel=package['release'], pkg_arch=package['arch'], orgid=org_id, checksum_type=package['checksum_type'], checksum=package['checksum']) else: h.execute(pkg_name=package['name'], pkg_epoch=pkg_epoch, pkg_version=package['version'], pkg_rel=package['release'], pkg_arch=package['arch'], orgid=org_id) |
|
row = h.fetchone_dict() | row = h.fetchone_dict() |
Clone # 8
Distance between two fragments = 4
Clone size = 22
Source file "./server/handlers/app/packages.py" The first line is 613 | Source file "./server/handlers/app/packages.py" The first line is 447 | |
def getSourcePackageMD5sum(self, username, password, info): log_debug(3) self._MD5sum2Checksum_info(info) return self._Checksum2MD5sum_list(self.getSourcePackageChecksum(username, password, info)) |
def getPackageMD5sum(self, username, password, info): log_debug(3) self._MD5sum2Checksum_info(info) return self._Checksum2MD5sum_list(self.getPackageChecksum(username, password, info)) |
|
def getSourcePackageChecksumBySession(self, session_string, info): log_debug(3) pkg_infos = info.get('packages') channels = info.get('channels', []) force = info.get('force', 0) orgid = info.get('org_id') try: if orgid == 'null': null_org = 1 else: null_org = None org_id, force = rhnPackageUpload.authenticate_session(session_string, channels=channels, null_org=null_org, force=force) except rhnSession.InvalidSessionError: raise rhnFault(33) except rhnSession.ExpiredSessionError: raise rhnFault(34) return self._getSourcePackageChecksum(org_id, pkg_infos) |
def getPackageChecksumBySession(self, session_string, info): log_debug(3) pkg_infos = info.get('packages') channels = info.get('channels', []) force = info.get('force', 0) orgid = info.get('org_id') try: if orgid == 'null': null_org = 1 else: null_org = None org_id, force = rhnPackageUpload.authenticate_session(session_string, channels=channels, null_org=null_org, force=force) except rhnSession.InvalidSessionError: raise rhnFault(33) except rhnSession.ExpiredSessionError: raise rhnFault(34) return self._getPackageChecksum(org_id, pkg_infos) |
Clone # 9
Distance between two fragments = 1
Clone size = 20
Source file "./common/test/unit-test/test_gettext.py" The first line is 130 | Source file "./common/test/unit-test/test_gettext.py" The first line is 74 | |
def test_go_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
def test_en_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
|
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
|
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
Clone # 10
Distance between two fragments = 2
Clone size = 20
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 463 | Source file "./server/handlers/xmlrpc/up2date.py" The first line is 432 | |
def __solveDep_arch(self, system_id, deps, action, clientVersion): log_debug(5, system_id, deps, action, clientVersion) faultString = _('Invalid value %s (%s)') if type(deps) not in (ListType, TupleType): log_error('Invalid argument type', type(deps)) raise rhnFault(30, (faultString) % ((deps, type(deps)))) for dep in deps: if type(dep) is not StringType: log_error('Invalid dependency member', type(dep)) raise rhnFault(30, (faultString) % ((dep, type(dep)))) deps = filter(len, deps) if not deps: return [] server = self.auth_system(system_id) log_debug(1, self.server_id, action, ('items: %d') % (len(deps))) result = rhnDependency.solve_dependencies_arch(self.server_id, deps, clientVersion) transport = rhnFlags.get('outputTransportOptions') transport['X-RHN-Action'] = action return result |
def __solveDep(self, system_id, deps, action, clientVersion): log_debug(5, system_id, deps, action, clientVersion) faultString = _('Invalid value %s (%s)') if type(deps) not in (ListType, TupleType): log_error('Invalid argument type', type(deps)) raise rhnFault(30, (faultString) % ((deps, type(deps)))) for dep in deps: if type(dep) is not StringType: log_error('Invalid dependency member', type(dep)) raise rhnFault(30, (faultString) % ((dep, type(dep)))) deps = filter(len, deps) if not deps: return [] server = self.auth_system(system_id) log_debug(1, self.server_id, action, ('items: %d') % (len(deps))) result = rhnDependency.solve_dependencies(self.server_id, deps, clientVersion) transport = rhnFlags.get('outputTransportOptions') transport['X-RHN-Action'] = action return result |
Clone # 11
Distance between two fragments = 3
Clone size = 19
Source file "./server/test/unit-test/test_server_registration.py" The first line is 225 | Source file "./server/test/misc_functions.py" The first line is 294 | |
class Counter: _counter = 0 def value(self): val = self._counter self._counter = (val) + (1) return val |
class Counter: _counter = 0 def value(self): val = self._counter self._counter = (val) + (1) return val |
|
def build_new_system_params_with_username(**kwargs): import time val = Counter().value() rnd_string = ('%d-%d') % ((int(time.time()), val)) params = {'os_release': '9', 'architecture': 'i686-redhat-linux', 'profile_name': ('unittest server ') + (rnd_string), 'username': 'no such user', 'password': 'no such password'} params.update(kwargs) if params.has_key('token'): params['token'] return params |
def build_sys_params_with_username(**kwargs): val = Counter().value() rnd_string = ('%s%s') % ((int(time.time()), val)) params = {'os_release': '9', 'architecture': 'i386', 'profile_name': ('unittest server ') + (rnd_string), 'username': 'no such user', 'password': 'no such password'} params.update(kwargs) if params.has_key('token'): params['token'] return params |
Clone # 12
Distance between two fragments = 3
Clone size = 19
Source file "./server/rhnChannel.py" The first line is 583 | Source file "./server/rhnChannel.py" The first line is 561 | |
def delete_channel_families(entries): if not isinstance(entries, ListType): raise InvalidEntryError(entries, 'Not a list') ret = [] for e in entries: if not isinstance(e, DictType): raise InvalidEntryError(e, 'Entry is not a dictionary') label = e.get('label') if not label: raise InvalidEntryError(e, 'Missing required field label') c = ChannelFamily() c.load_by_label(label) if not c.exists(): ret.append(label) continue msg = _delete_channel_family(c) if msg is not None: ret.append(msg) return ret |
def delete_channels(entries): if not isinstance(entries, ListType): raise InvalidEntryError(entries, 'Not a list') ret = [] for e in entries: if not isinstance(e, DictType): raise InvalidEntryError(e, 'Entry is not a dictionary') label = e.get('label') if not label: raise InvalidEntryError(e, 'Missing required field label') c = Channel() c.load_by_label(label) if not c.exists(): ret.append(label) continue msg = _delete_channel(c) if msg is not None: ret.append(msg) return ret |
Clone # 13
Distance between two fragments = 4
Clone size = 17
Source file "./server/rhnChannel.py" The first line is 670 | Source file "./server/rhnChannel.py" The first line is 646 | |
if pattern: query = '\n select id \n from rhnChannel\n where label like :pattern\n ' h = rhnSQL.prepare(query) h.execute(pattern=pattern) else: query = 'select id from rhnChannel' h = rhnSQL.prepare(query) h.execute() |
if pattern: query = '\n select id \n from rhnChannelFamily \n where org_id is null\n and label like :pattern\n ' h = rhnSQL.prepare(query) h.execute(pattern=pattern) else: query = 'select id from rhnChannelFamily where org_id is null' h = rhnSQL.prepare(query) h.execute() |
|
ret = [] | ret = [] | |
while 1: row = h.fetchone_dict() if not row: break channel_id = row['id'] c = Channel().load_by_id(channel_id) ret.append(c.as_dict()) |
while 1: row = h.fetchone_dict() if not row: break channel_family_id = row['id'] c = ChannelFamily().load_by_id(channel_family_id) ret.append(c.as_dict()) |
|
return ret | return ret |
Clone # 14
Distance between two fragments = 0
Clone size = 17
Source file "./common/rhn_memusage.py" The first line is 18 | Source file "./server/test/test-cx_Oracle-memleak.py" The first line is 24 | |
def mem_usage(): f = open('/proc/self/status') dict = {} while 1: line = f.readline() if not line: break arr = map(string.strip, string.split(line, ':', 1)) if len(arr) == 1: continue dict[arr[0]] = arr[1] return (dict['Name'], dict['VmSize'], dict['VmRSS'], dict['VmData']) |
def mem_usage(): f = open('/proc/self/status') dict = {} while 1: line = f.readline() if not line: break arr = map(string.strip, string.split(line, ':', 1)) if len(arr) == 1: continue dict[arr[0]] = arr[1] return (dict['Name'], dict['VmSize'], dict['VmRSS'], dict['VmData']) |
|
def _line_value(line): arr = string.split(line, ':', 1) if len(arr) == 1: return None return string.strip(arr[1]) |
def _line_value(line): arr = string.split(line, ':', 1) if len(arr) == 1: return None return string.strip(arr[1]) |
Clone # 15
Distance between two fragments = 1
Clone size = 17
Source file "./server/importlib/packageImport.py" The first line is 531 | Source file "./server/importlib/packageImport.py" The first line is 308 | |
def submit(self): upload_force = self.uploadForce if (not upload_force) and (self._update_last_modified): upload_force = 0.5 try: self.backend.processSourcePackages(self.batch, uploadForce=upload_force, forceVerify=self.forceVerify, ignoreUploaded=self.ignoreUploaded, transactional=self.transactional) except: self.backend.rollback() raise self.backend.commit() if not self._update_last_modified: for p in self.batch: if (p.diff) and (p.diff.level == 0.5): p.diff = None |
def submit(self): upload_force = self.uploadForce if (not upload_force) and (self._update_last_modified): upload_force = 0.5 try: self.backend.processPackages(self.batch, uploadForce=upload_force, forceVerify=self.forceVerify, ignoreUploaded=self.ignoreUploaded, transactional=self.transactional) except: self.backend.rollback() raise self.backend.commit() if not self._update_last_modified: for p in self.batch: if (p.diff) and (p.diff.level == 0.5): p.diff = None |
Clone # 16
Distance between two fragments = 1
Clone size = 16
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 536 | Source file "./server/rhnSQL/sql_lib.py" The first line is 76 | |
def __check_Int_String(name, value, package=package): if type(value) not in (StringType, IntType): log_error(("Field %s (%s)=`%s' in %s does not pass type checks") % ((name, type(value), str(value), str(package)))) raise rhnFault(30, (_('Invalid value for %s in package tuple: %s (%s)')) % ((name, value, type(value)))) value = str(value) if not len(value): log_error(('Field %s has an EMPTY value in %s') % ((value, package))) return value |
def __check_Int_String(name, value, package=package): if type(value) not in (StringType, IntType): log_error(("Field %s (%s) = `%s' in %s does not pass type checks") % ((name, type(value), str(value), str(package)))) raise rhnFault(30, (_('Invalid value for %s in package tuple: %s (%s)')) % ((name, value, type(value)))) value = str(value) if not len(value): log_error(('Field %s has an EMPTY value in %s') % ((value, package))) return value |
|
log_debug(4, package) | log_debug(4, package) | |
if (type(package) not in (ListType, TupleType)) or (len(package) < 3): log_error(('Package argument %s (len = %d) does not pass type checks') % ((str(package), len(package)))) raise rhnFault(30, (_('Invalid package parameter %s (%s)')) % ((package, type(package)))) |
if (type(package) not in (ListType, TupleType)) or (len(package) < 3): log_error(('Package argument %s (len = %d) does not pass type checks') % ((str(package), len(package)))) raise rhnFault(30, (_('Invalid package parameter %s (%s)')) % ((package, type(package)))) |
Clone # 17
Distance between two fragments = 3
Clone size = 16
Source file "./server/test/test_leak4.py" The first line is 21 | Source file "./server/test/test_leak2.py" The first line is 22 | |
db = connect('rhnuser/rhnuser@webdev') | dbh = Connect('rhnuser/rhnuser@webdev') | |
c = db.prepare('select 1 from dual') | h = dbh.prepare('select 1 from dual') | |
start = time.time() | start = time.time() | |
i = 0 | i = 0 | |
write = sys.stderr.write | write = sys.stderr.write | |
while i < 10000: c.execute() if (i) % (100) == 0: f = open('/proc/self/status') l = f.readlines() vmsize = l[10][10:-1] vmrss = l[12][10:-1] f.close() write(('%d %.3f vsz: %s rss: %s \n') % ((i, (time.time()) - (start), vmsize, vmrss))) i = (i) + (1) |
while i < 10000: h.execute() if (i) % (100) == 0: f = open('/proc/self/status') l = f.readlines() vmsize = l[10][10:-1] vmrss = l[12][10:-1] f.close() write(('%d %.3f vsz: %s rss: %s \n') % ((i, (time.time()) - (start), vmsize, vmrss))) i = (i) + (1) |
Clone # 18
Distance between two fragments = 2
Clone size = 15
Source file "./server/handlers/app/channel.py" The first line is 525 | Source file "./server/handlers/app/channel.py" The first line is 497 | |
def revokeChannelPermission(self, label, role, commit, username, password): log_debug(3) self._auth(username, password) h = rhnSQL.prepare('\n delete from rhnchannelpermission\n where (channel_id, role_id, user_id) in\n (select c.id, cpr.id, wc.id\n from rhnchannelpermissionrole cpr,\n rhnchannel c,\n web_contact wc\n where wc.login = :username\n and c.label = :label\n and cpr.label = :role_label)\n ') try: h.execute(username=username, label=label, role_label=role) except rhnSQL.SQLError, e: rhnSQL.rollback() raise rhnFault(23, str(e.args[1]), explain=0) if commit: rhnSQL.commit() else: rhnSQL.rollback() return 1 return 0 |
def channelManagePermission(self, label, role, commit, username, password): log_debug(3) self._auth(username, password) h = rhnSQL.prepare('\n insert into rhnChannelPermission\n (channel_id, role_id, user_id)\n (select c.id, cpr.id, wc.id\n from rhnchannelpermissionrole cpr,\n rhnchannel c,\n web_contact wc\n where wc.login = :username \n and c.label = :label\n and cpr.label = :role_label)\n ') try: h.execute(username=username, label=label, role_label=role) except rhnSQL.SQLError, e: rhnSQL.rollback() raise rhnFault(23, str(e.args[1]), explain=0) if commit: rhnSQL.commit() else: rhnSQL.rollback() return 1 return 0 |
Clone # 19
Distance between two fragments = 0
Clone size = 15
Source file "./spacewalk/common/rhn_mpm.py" The first line is 127 | Source file "./server/handlers/app/rhn_mpm.py" The first line is 103 | |
_lead_format = '!16sB3s4L92s' | _lead_format = '!16sB3s4L92s' | |
_magic = 'mpmpackage012345' | _magic = 'mpmpackage012345' | |
def __init__(self): self.header = None self.payload_stream = None self.header_flags = MPM_HEADER_COMPRESSED_GZIP self.payload_flags = 0 assert len(self._magic) == 16 self._buffer_size = 16384 |
def __init__(self): self.header = None self.payload_stream = None self.header_flags = MPM_HEADER_COMPRESSED_GZIP self.payload_flags = 0 assert len(self._magic) == 16 self._buffer_size = 16384 |
|
def _read_lead(self, stream): lead = self._read_bytes(stream, 128) if len(lead) != 128: raise InvalidPackageError() arr = struct.unpack(self._lead_format, lead) return arr |
def _read_lead(self, stream): lead = self._read_bytes(stream, 128) if len(lead) != 128: raise InvalidPackageError() arr = struct.unpack(self._lead_format, lead) return arr |
Clone # 20
Distance between two fragments = 0
Clone size = 15
Source file "./satellite_tools/satComputePkgHeaders.py" The first line is 28 | Source file "./_apache.py" The first line is 21 | |
SERVER_RETURN = 0 | SERVER_RETURN = 0 | |
def log_error(*args): pass |
def log_error(*args): pass |
|
def make_table(*args): pass |
def make_table(*args): pass |
|
def parse_qs(*args): pass |
def parse_qs(*args): pass |
|
def parse_qsl(*args): pass |
def parse_qsl(*args): pass |
|
status = None | status = None | |
table = None | table = None | |
config_tree = None | config_tree = None | |
server_root = None | server_root = None | |
mpm_query = None | mpm_query = None | |
exists_config_define = None | exists_config_define = None |
Clone # 21
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 378 | Source file "./satellite_tools/sync_handlers.py" The first line is 292 | |
class ErrataContainer(xmlSource.ErrataContainer): def endItemCallback(self): xmlSource.ErrataContainer.endItemCallback(self) if not self.batch: return None c = ErrataCollection() c.add_erratum(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class PackageContainer(xmlSource.PackageContainer): def endItemCallback(self): xmlSource.PackageContainer.endItemCallback(self) if not self.batch: return None c = PackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_errata_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ErrataContainer()) return handler |
def get_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(PackageContainer()) return handler |
Clone # 22
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 378 | Source file "./satellite_tools/sync_handlers.py" The first line is 410 | |
class ErrataContainer(xmlSource.ErrataContainer): def endItemCallback(self): xmlSource.ErrataContainer.endItemCallback(self) if not self.batch: return None c = ErrataCollection() c.add_erratum(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class KickstartableTreesContainer(xmlSource.KickstartableTreesContainer): def endItemCallback(self): xmlSource.KickstartableTreesContainer.endItemCallback(self) if not self.batch: return None c = KickstartableTreesCollection() c.add_item(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_errata_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ErrataContainer()) return handler |
def get_kickstarts_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(KickstartableTreesContainer()) return handler |
Clone # 23
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 378 | Source file "./satellite_tools/sync_handlers.py" The first line is 163 | |
class ErrataContainer(xmlSource.ErrataContainer): def endItemCallback(self): xmlSource.ErrataContainer.endItemCallback(self) if not self.batch: return None c = ErrataCollection() c.add_erratum(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class ChannelContainer(xmlSource.ChannelContainer): def endItemCallback(self): xmlSource.ChannelContainer.endItemCallback(self) if not self.batch: return None c = ChannelCollection() c.add_channel(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_errata_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ErrataContainer()) return handler |
def get_channel_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ChannelContainer()) return handler |
Clone # 24
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 378 | Source file "./satellite_tools/sync_handlers.py" The first line is 319 | |
class ErrataContainer(xmlSource.ErrataContainer): def endItemCallback(self): xmlSource.ErrataContainer.endItemCallback(self) if not self.batch: return None c = ErrataCollection() c.add_erratum(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class SourcePackageContainer(xmlSource.SourcePackageContainer): def endItemCallback(self): xmlSource.SourcePackageContainer.endItemCallback(self) if not self.batch: return None c = SourcePackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_errata_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ErrataContainer()) return handler |
def get_source_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(SourcePackageContainer()) return handler |
Clone # 25
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 292 | Source file "./satellite_tools/sync_handlers.py" The first line is 263 | |
class PackageContainer(xmlSource.PackageContainer): def endItemCallback(self): xmlSource.PackageContainer.endItemCallback(self) if not self.batch: return None c = PackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class ShortPackageContainer(xmlSource.IncompletePackageContainer): def endItemCallback(self): xmlSource.IncompletePackageContainer.endItemCallback(self) if not self.batch: return None c = ShortPackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(PackageContainer()) return handler |
def get_short_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ShortPackageContainer()) return handler |
Clone # 26
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 292 | Source file "./satellite_tools/sync_handlers.py" The first line is 410 | |
class PackageContainer(xmlSource.PackageContainer): def endItemCallback(self): xmlSource.PackageContainer.endItemCallback(self) if not self.batch: return None c = PackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class KickstartableTreesContainer(xmlSource.KickstartableTreesContainer): def endItemCallback(self): xmlSource.KickstartableTreesContainer.endItemCallback(self) if not self.batch: return None c = KickstartableTreesCollection() c.add_item(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(PackageContainer()) return handler |
def get_kickstarts_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(KickstartableTreesContainer()) return handler |
Clone # 27
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 292 | Source file "./satellite_tools/sync_handlers.py" The first line is 163 | |
class PackageContainer(xmlSource.PackageContainer): def endItemCallback(self): xmlSource.PackageContainer.endItemCallback(self) if not self.batch: return None c = PackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class ChannelContainer(xmlSource.ChannelContainer): def endItemCallback(self): xmlSource.ChannelContainer.endItemCallback(self) if not self.batch: return None c = ChannelCollection() c.add_channel(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(PackageContainer()) return handler |
def get_channel_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ChannelContainer()) return handler |
Clone # 28
Distance between two fragments = 3
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 292 | Source file "./satellite_tools/sync_handlers.py" The first line is 319 | |
class PackageContainer(xmlSource.PackageContainer): def endItemCallback(self): xmlSource.PackageContainer.endItemCallback(self) if not self.batch: return None c = PackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class SourcePackageContainer(xmlSource.SourcePackageContainer): def endItemCallback(self): xmlSource.SourcePackageContainer.endItemCallback(self) if not self.batch: return None c = SourcePackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(PackageContainer()) return handler |
def get_source_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(SourcePackageContainer()) return handler |
Clone # 29
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 263 | Source file "./satellite_tools/sync_handlers.py" The first line is 319 | |
class ShortPackageContainer(xmlSource.IncompletePackageContainer): def endItemCallback(self): xmlSource.IncompletePackageContainer.endItemCallback(self) if not self.batch: return None c = ShortPackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class SourcePackageContainer(xmlSource.SourcePackageContainer): def endItemCallback(self): xmlSource.SourcePackageContainer.endItemCallback(self) if not self.batch: return None c = SourcePackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_short_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ShortPackageContainer()) return handler |
def get_source_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(SourcePackageContainer()) return handler |
Clone # 30
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 410 | Source file "./satellite_tools/sync_handlers.py" The first line is 163 | |
class KickstartableTreesContainer(xmlSource.KickstartableTreesContainer): def endItemCallback(self): xmlSource.KickstartableTreesContainer.endItemCallback(self) if not self.batch: return None c = KickstartableTreesCollection() c.add_item(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class ChannelContainer(xmlSource.ChannelContainer): def endItemCallback(self): xmlSource.ChannelContainer.endItemCallback(self) if not self.batch: return None c = ChannelCollection() c.add_channel(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_kickstarts_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(KickstartableTreesContainer()) return handler |
def get_channel_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ChannelContainer()) return handler |
Clone # 31
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 410 | Source file "./satellite_tools/sync_handlers.py" The first line is 319 | |
class KickstartableTreesContainer(xmlSource.KickstartableTreesContainer): def endItemCallback(self): xmlSource.KickstartableTreesContainer.endItemCallback(self) if not self.batch: return None c = KickstartableTreesCollection() c.add_item(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class SourcePackageContainer(xmlSource.SourcePackageContainer): def endItemCallback(self): xmlSource.SourcePackageContainer.endItemCallback(self) if not self.batch: return None c = SourcePackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_kickstarts_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(KickstartableTreesContainer()) return handler |
def get_source_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(SourcePackageContainer()) return handler |
Clone # 32
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/sync_handlers.py" The first line is 163 | Source file "./satellite_tools/sync_handlers.py" The first line is 319 | |
class ChannelContainer(xmlSource.ChannelContainer): def endItemCallback(self): xmlSource.ChannelContainer.endItemCallback(self) if not self.batch: return None c = ChannelCollection() c.add_channel(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class SourcePackageContainer(xmlSource.SourcePackageContainer): def endItemCallback(self): xmlSource.SourcePackageContainer.endItemCallback(self) if not self.batch: return None c = SourcePackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
|
def get_channel_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(ChannelContainer()) return handler |
def get_source_package_handler(): handler = xmlSource.SatelliteDispatchHandler() handler.set_container(SourcePackageContainer()) return handler |
Clone # 33
Distance between two fragments = 0
Clone size = 14
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 500 | Source file "./server/handlers/xmlrpc/up2date.py" The first line is 468 | |
log_debug(5, system_id, deps, action, clientVersion) | log_debug(5, system_id, deps, action, clientVersion) | |
faultString = _('Invalid value %s (%s)') | faultString = _('Invalid value %s (%s)') | |
if type(deps) not in (ListType, TupleType): log_error('Invalid argument type', type(deps)) raise rhnFault(30, (faultString) % ((deps, type(deps)))) |
if type(deps) not in (ListType, TupleType): log_error('Invalid argument type', type(deps)) raise rhnFault(30, (faultString) % ((deps, type(deps)))) |
|
for dep in deps: if type(dep) is not StringType: log_error('Invalid dependency member', type(dep)) raise rhnFault(30, (faultString) % ((dep, type(dep)))) |
for dep in deps: if type(dep) is not StringType: log_error('Invalid dependency member', type(dep)) raise rhnFault(30, (faultString) % ((dep, type(dep)))) |
|
deps = filter(len, deps) | deps = filter(len, deps) | |
if not deps: return [] |
if not deps: return [] |
|
server = self.auth_system(system_id) | server = self.auth_system(system_id) | |
log_debug(1, self.server_id, action, ('items: %d') % (len(deps))) | log_debug(1, self.server_id, action, ('items: %d') % (len(deps))) |
Clone # 34
Distance between two fragments = 0
Clone size = 14
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 500 | Source file "./server/handlers/xmlrpc/up2date.py" The first line is 437 | |
log_debug(5, system_id, deps, action, clientVersion) | log_debug(5, system_id, deps, action, clientVersion) | |
faultString = _('Invalid value %s (%s)') | faultString = _('Invalid value %s (%s)') | |
if type(deps) not in (ListType, TupleType): log_error('Invalid argument type', type(deps)) raise rhnFault(30, (faultString) % ((deps, type(deps)))) |
if type(deps) not in (ListType, TupleType): log_error('Invalid argument type', type(deps)) raise rhnFault(30, (faultString) % ((deps, type(deps)))) |
|
for dep in deps: if type(dep) is not StringType: log_error('Invalid dependency member', type(dep)) raise rhnFault(30, (faultString) % ((dep, type(dep)))) |
for dep in deps: if type(dep) is not StringType: log_error('Invalid dependency member', type(dep)) raise rhnFault(30, (faultString) % ((dep, type(dep)))) |
|
deps = filter(len, deps) | deps = filter(len, deps) | |
if not deps: return [] |
if not deps: return [] |
|
server = self.auth_system(system_id) | server = self.auth_system(system_id) | |
log_debug(1, self.server_id, action, ('items: %d') % (len(deps))) | log_debug(1, self.server_id, action, ('items: %d') % (len(deps))) |
Clone # 35
Distance between two fragments = 2
Clone size = 14
Source file "./satellite_tools/satsync.py" The first line is 1669 | Source file "./satellite_tools/satsync.py" The first line is 1398 | |
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=erratum_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=kt_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
ss = SequenceServer(erratum_ids[:], nevermorethan=self._batch_size) | ss = SequenceServer(ktids[:], nevermorethan=self._batch_size) | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 36
Distance between two fragments = 2
Clone size = 14
Source file "./satellite_tools/satsync.py" The first line is 1669 | Source file "./satellite_tools/satsync.py" The first line is 1288 | |
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=erratum_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
ss = SequenceServer(erratum_ids[:], nevermorethan=self._batch_size) | ss = SequenceServer(pids[:], nevermorethan=self._batch_size) | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 37
Distance between two fragments = 2
Clone size = 14
Source file "./satellite_tools/satsync.py" The first line is 1669 | Source file "./satellite_tools/satsync.py" The first line is 1112 | |
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=erratum_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
ss = SequenceServer(erratum_ids[:], nevermorethan=self._batch_size) | ss = SequenceServer(pids[:], nevermorethan=self._batch_size) | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 38
Distance between two fragments = 2
Clone size = 14
Source file "./satellite_tools/satsync.py" The first line is 1398 | Source file "./satellite_tools/satsync.py" The first line is 1288 | |
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=kt_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
ss = SequenceServer(ktids[:], nevermorethan=self._batch_size) | ss = SequenceServer(pids[:], nevermorethan=self._batch_size) | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 39
Distance between two fragments = 2
Clone size = 14
Source file "./satellite_tools/satsync.py" The first line is 1398 | Source file "./satellite_tools/satsync.py" The first line is 1112 | |
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=kt_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
ss = SequenceServer(ktids[:], nevermorethan=self._batch_size) | ss = SequenceServer(pids[:], nevermorethan=self._batch_size) | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 40
Distance between two fragments = 4
Clone size = 14
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 502 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 478 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting arches extra...') | log2stdout(1, 'Exporting arches...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) | |
self.set_filename(self.fm.getArchesExtraFile()) | self.set_filename(self.fm.getArchesFile()) | |
dumper.XML_Dumper.dump_server_group_type_server_arches(self) | dumper.XML_Dumper.dump_arches(self) | |
pb.addTo(1) | pb.addTo(1) | |
pb.printIncrement() | pb.printIncrement() | |
pb.printComplete() | pb.printComplete() | |
log2stdout(4, ('Arches Extra exported to %s') % (self.fm.getArchesExtraFile())) | log2stdout(4, ('Arches exported to %s') % (self.fm.getArchesFile())) |
Clone # 41
Distance between two fragments = 4
Clone size = 14
Source file "./server/handlers/config_mgmt/rhn_config_management.py" The first line is 486 | Source file "./server/handlers/config_mgmt/rhn_config_management.py" The first line is 460 | |
fdst = self._get_file(config_channel_dst, path, revision=revision_dst) | fsrc = self._get_file(config_channel_src, path, revision=revision_src) | |
if not fdst: raise rhnFault(4011, ('File %s (revision %s) does not exist in channel %s') % ((path, revision_dst, config_channel_dst)), explain=0) |
if not fsrc: raise rhnFault(4011, ('File %s (revision %s) does not exist in channel %s') % ((path, revision_src, config_channel_src)), explain=0) |
|
if fdst['is_binary'] == 'Y': raise rhnFault(4004, ('File %s (revision %s) seems to contain binary data') % ((path, revision_dst)), explain=0) |
if fsrc['is_binary'] == 'Y': raise rhnFault(4004, ('File %s (revision %s) seems to contain binary data') % ((path, revision_src)), explain=0) |
|
fd, filename_dst = tempfile.mkstemp(prefix='/tmp/rhncfg-') | fd, filename_src = tempfile.mkstemp(prefix='/tmp/rhncfg-') | |
fc_lob = fdst['file_contents'] | fc_lob = fsrc['file_contents'] | |
if fc_lob: os.write(fd, rhnSQL.read_lob(fc_lob)) |
if fc_lob: os.write(fd, rhnSQL.read_lob(fc_lob)) |
|
os.close(fd) | os.close(fd) |
Clone # 42
Distance between two fragments = 1
Clone size = 14
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 91 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 47 | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.Channel() | |
for k, v in vdict.items(): method = getattr(c, ('set_') + (k)) method(v) |
for k, v in vdict.items(): method = getattr(c, ('set_') + (k)) method(v) |
|
c.save() | c.save() | |
channel_id = c.get_id() | channel_id = c.get_id() | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.Channel() | |
c.load_by_label(label) | c.load_by_label(label) | |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
|
rhnSQL.commit() | rhnSQL.commit() | |
return c | return c |
Clone # 43
Distance between two fragments = 0
Clone size = 14
Source file "./server/handlers/app/packages.py" The first line is 677 | Source file "./server/handlers/app/packages.py" The first line is 549 | |
row = h.fetchone_dict() | row = h.fetchone_dict() | |
if not row: row_list[pkg] = '' continue |
if not row: row_list[pkg] = '' continue |
|
if row.has_key('path'): filePath = os.path.join(CFG.MOUNT_POINT, row['path']) if os.access(filePath, os.R_OK): if row.has_key('checksum'): row_list[pkg] = (row['checksum_type'], row['checksum']) else: row_list[pkg] = 'on-disk' else: log_error('Package not found', filePath) row_list[pkg] = '' else: log_error('Package path null for package', filePath) row_list[pkg] = '' |
if row.has_key('path'): filePath = os.path.join(CFG.MOUNT_POINT, row['path']) if os.access(filePath, os.R_OK): if row.has_key('checksum'): row_list[pkg] = (row['checksum_type'], row['checksum']) else: row_list[pkg] = 'on-disk' else: log_error('Package not found', filePath) row_list[pkg] = '' else: log_error('Package path null for package', filePath) row_list[pkg] = '' |
Clone # 44
Distance between two fragments = 0
Clone size = 13
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 324 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 264 | |
val = rhnCache.get(key, compressed=0, raw=1, modified=last_modified) | val = rhnCache.get(key, compressed=0, raw=1, modified=last_modified) | |
if val is None: log_debug(4, ('Cache MISS for %s (%s)') % ((channel_label, channel_id))) stream = self._cache_channel_packages_short(channel_id, key, last_modified) else: log_debug(4, ('Cache HIT for %s (%s)') % ((channel_label, channel_id))) temp_stream = tempfile.TemporaryFile() temp_stream.write(val) temp_stream.flush() stream = self._normalize_compressed_stream(temp_stream) |
if val is None: log_debug(4, ('Cache MISS for %s (%s)') % ((channel_label, channel_id))) stream = self._cache_channel_packages_short(channel_id, key, last_modified) else: log_debug(4, ('Cache HIT for %s (%s)') % ((channel_label, channel_id))) temp_stream = tempfile.TemporaryFile() temp_stream.write(val) temp_stream.flush() stream = self._normalize_compressed_stream(temp_stream) |
|
buffer_size = 16384 | buffer_size = 16384 |
Clone # 45
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 550 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 526 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting channel families...') | log2stdout(1, 'Exporting blacklists...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) | |
self.set_filename(self.fm.getChannelFamiliesFile()) | self.set_filename(self.fm.getBlacklistsFile()) | |
dumper.XML_Dumper.dump_channel_families(self) | dumper.XML_Dumper.dump_blacklist_obsoletes(self) | |
pb.addTo(1) | pb.addTo(1) | |
pb.printIncrement() | pb.printIncrement() | |
pb.printComplete() | pb.printComplete() |
Clone # 46
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 550 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 502 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting channel families...') | log2stdout(1, 'Exporting arches extra...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) | |
self.set_filename(self.fm.getChannelFamiliesFile()) | self.set_filename(self.fm.getArchesExtraFile()) | |
dumper.XML_Dumper.dump_channel_families(self) | dumper.XML_Dumper.dump_server_group_type_server_arches(self) | |
pb.addTo(1) | pb.addTo(1) | |
pb.printIncrement() | pb.printIncrement() | |
pb.printComplete() | pb.printComplete() |
Clone # 47
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 550 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 478 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting channel families...') | log2stdout(1, 'Exporting arches...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) | |
self.set_filename(self.fm.getChannelFamiliesFile()) | self.set_filename(self.fm.getArchesFile()) | |
dumper.XML_Dumper.dump_channel_families(self) | dumper.XML_Dumper.dump_arches(self) | |
pb.addTo(1) | pb.addTo(1) | |
pb.printIncrement() | pb.printIncrement() | |
pb.printComplete() | pb.printComplete() |
Clone # 48
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 526 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 502 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting blacklists...') | log2stdout(1, 'Exporting arches extra...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) | |
self.set_filename(self.fm.getBlacklistsFile()) | self.set_filename(self.fm.getArchesExtraFile()) | |
dumper.XML_Dumper.dump_blacklist_obsoletes(self) | dumper.XML_Dumper.dump_server_group_type_server_arches(self) | |
pb.addTo(1) | pb.addTo(1) | |
pb.printIncrement() | pb.printIncrement() | |
pb.printComplete() | pb.printComplete() |
Clone # 49
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 526 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 478 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting blacklists...') | log2stdout(1, 'Exporting arches...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, 1, self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) | |
self.set_filename(self.fm.getBlacklistsFile()) | self.set_filename(self.fm.getArchesFile()) | |
dumper.XML_Dumper.dump_blacklist_obsoletes(self) | dumper.XML_Dumper.dump_arches(self) | |
pb.addTo(1) | pb.addTo(1) | |
pb.printIncrement() | pb.printIncrement() | |
pb.printComplete() | pb.printComplete() |
Clone # 50
Distance between two fragments = 4
Clone size = 13
Source file "./server/rhnChannel.py" The first line is 1672 | Source file "./server/rhnChannel.py" The first line is 1554 | |
log_debug(3, channel) | log_debug(3, channel) | |
c_info = channel_info(channel) | c_info = channel_info(channel) | |
if not c_info: raise rhnFault(40, ("could not find any data on channel '%s'") % (channel)) |
if not c_info: raise rhnFault(40, ("could not find any data on channel '%s'") % (channel)) |
|
cache_entry = ('blacklist_obsoletes-%s') % (channel) | cache_entry = ('list_obsoletes-%s') % (channel) | |
ret = rhnCache.get(cache_entry, c_info['last_modified']) | ret = rhnCache.get(cache_entry, c_info['last_modified']) | |
if ret: log_debug(4, 'Scored cache hit', channel) return ret |
if ret: log_debug(4, 'Scored cache hit', channel) return ret |
|
h = rhnSQL.prepare('\n select unique \n pnsrc.name src_name, \n bo.src_epoch,\n bo.src_version,\n bo.src_release,\n cdst.label dst_channel,\n pndst.name dst_name,\n bo.dst_epoch,\n bo.dst_version,\n bo.dst_release\n from \n rhnChannel csrc, rhnChannel cdst, \n rhnPackageName pnsrc, rhnPackageName pndst,\n rhnBlacklistObsoletes bo\n where bo.src_channel_id = csrc.id\n and csrc.label = :channel\n and bo.dst_channel_id = cdst.id (+)\n and bo.src_name_id = pnsrc.id\n and bo.dst_name_id = pndst.id\n order by pnsrc.name, pndst.name\n ') | h = rhnSQL.prepare('\n select distinct\n pn.name,\n pe.version, pe.release, pe.epoch,\n pa.label arch,\n pc.name obsolete_name,\n pc.version obsolete_version,\n p_info.sense\n from rhnPackageCapability pc,\n rhnPackageArch pa,\n rhnPackageEVR pe,\n rhnPackageName pn,\n rhnPackage p,\n ( select cp.channel_id,\n po.package_id, po.capability_id, po.sense\n from rhnPackageObsoletes po,\n rhnChannelPackage cp,\n rhnChannel c\n where 1=1\n and c.label = :channel\n and c.id = cp.channel_id\n and cp.package_id = po.package_id\n minus\n -- obsoletes that are blacklisted follow\n select cp.channel_id,\n po.package_id, po.capability_id, po.sense\n from rhnPackageName pni,\n rhnPackageCapability pc,\n rhnBlacklistObsoletes bo,\n rhnPackage p,\n rhnPackageObsoletes po,\n rhnChannelPackage cp,\n rhnChannel c\n where 1=1\n and c.label = :channel\n and c.id = cp.channel_id\n -- find all the packages we have obsoletes for\n and cp.package_id = po.package_id\n -- now find the name, and get the blacklists that apply\n and po.package_id = p.id\n and p.name_id = bo.name_id\n and p.evr_id = bo.evr_id\n and p.package_arch_id = bo.package_arch_id\n -- now match the blacklisted names to the caps\n and po.capability_id = pc.id\n and pc.name = pni.name\n and bo.ignore_name_id = pni.id\n ) p_info\n where 1=1\n and p_info.package_id = p.id\n and p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p_info.capability_id = pc.id\n ') | |
h.execute(channel=str(channel)) | h.execute(channel=str(channel)) | |
result = [] | hash = {} |
Clone # 51
Distance between two fragments = 0
Clone size = 13
Source file "./spacewalk/common/rhn_mpm.py" The first line is 280 | Source file "./server/handlers/app/rhn_mpm.py" The first line is 257 | |
def _replace_null(obj): if obj is None: return '' if isinstance(obj, ListType): return map(_replace_null, obj) if isinstance(obj, TupleType): return tuple(_replace_null(list(obj))) if hasattr(obj, 'items'): dict = {} for k, v in obj.items(): dict[_replace_null(k)] = _replace_null(v) return dict return obj |
def _replace_null(obj): if obj is None: return '' if isinstance(obj, ListType): return map(_replace_null, obj) if isinstance(obj, TupleType): return tuple(_replace_null(list(obj))) if hasattr(obj, 'items'): dict = {} for k, v in obj.items(): dict[_replace_null(k)] = _replace_null(v) return dict return obj |
Clone # 52
Distance between two fragments = 0
Clone size = 12
Source file "./server/importlib/userAuth.py" The first line is 205 | Source file "./server/importlib/userAuth.py" The first line is 167 | |
org_id = user.contact['org_id'] | org_id = user.contact['org_id'] | |
user_id = user.getid() | user_id = user.getid() | |
h = rhnSQL.prepare('\n select ugt.label\n from rhnUserGroupType ugt,\n rhnUserGroup ug,\n rhnUserGroupMembers ugm\n where ugm.user_id = :user_id\n and ugm.user_group_id = ug.id\n and ug.group_type = ugt.id\n ') | h = rhnSQL.prepare('\n select ugt.label\n from rhnUserGroupType ugt,\n rhnUserGroup ug,\n rhnUserGroupMembers ugm\n where ugm.user_id = :user_id\n and ugm.user_group_id = ug.id\n and ug.group_type = ugt.id\n ') | |
h.execute(user_id=user_id) | h.execute(user_id=user_id) | |
groups = [] | groups = [] | |
while 1: row = h.fetchone_dict() if not row: break groups.append(row['label']) |
while 1: row = h.fetchone_dict() if not row: break groups.append(row['label']) |
|
return (groups, org_id, user_id) | return (groups, org_id, user_id) |
Clone # 53
Distance between two fragments = 2
Clone size = 12
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 750 | Source file "./satellite_tools/exporter/exportLib.py" The first line is 208 | |
channel_id = self._row['id'] | channel_id = self._row['id'] | |
arr = [] | arr = [] | |
mappings = [('rhn-channel-parent-channel', 'parent_channel'), ('rhn-channel-basedir', 'basedir'), ('rhn-channel-name', 'name'), ('rhn-channel-summary', 'summary'), ('rhn-channel-description', 'description'), ('rhn-channel-gpg-key-url', 'gpg_key_url'), ('rhn-channel-checksum-type', 'checksum_type')] | mappings = [('rhn-channel-parent-channel', 'parent_channel'), ('rhn-channel-basedir', 'basedir'), ('rhn-channel-name', 'name'), ('rhn-channel-summary', 'summary'), ('rhn-channel-description', 'description'), ('rhn-channel-gpg-key-url', 'gpg_key_url'), ('rhn-channel-checksum-type', 'checksum_type')] | |
for k, v in mappings: arr.append(exportLib.SimpleDumper(self._writer, k, self._row[v])) |
for k, v in mappings: arr.append(SimpleDumper(self._writer, k, self._row[v])) |
Clone # 54
Distance between two fragments = 4
Clone size = 12
Source file "./server/importlib/test/test_blob_update.py" The first line is 168 | Source file "./server/importlib/test/test_blob_update.py" The first line is 143 | |
v1 = v[2] | i1 = v[0] | |
v2 = v[3] | i2 = v[1] | |
hval = {'id1': i1} | hval = {'id1': i1} | |
if i2 is None: s = 'id2 is null' else: s = 'id2 = :id2' hval['id2'] = i2 |
if i2 is None: s = 'id2 is null' else: s = 'id2 = :id2' hval['id2'] = i2 |
|
h = rhnSQL.prepare((q) % (s)) | h = rhnSQL.prepare((q) % (s)) | |
apply(h.execute, (), hval) | apply(h.execute, (), hval) | |
row = h.fetchone_dict() | row = h.fetchone_dict() | |
val1 = row['val1'] | val1 = row['val1'] | |
val2 = row['val2'] | val2 = row['val2'] |
Clone # 55
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/xmlSource.py" The first line is 601 | Source file "./satellite_tools/xmlSource.py" The first line is 593 | |
class RequiresItem(BaseItem): item_name = 'rhn-package-requires-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
class ProvidesItem(BaseItem): item_name = 'rhn-package-provides-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
|
addItem(RequiresItem) | addItem(ProvidesItem) | |
class ConflictsItem(BaseItem): item_name = 'rhn-package-conflicts-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
class RequiresItem(BaseItem): item_name = 'rhn-package-requires-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
|
addItem(ConflictsItem) | addItem(RequiresItem) |
Clone # 56
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/xmlSource.py" The first line is 609 | Source file "./satellite_tools/xmlSource.py" The first line is 593 | |
class ConflictsItem(BaseItem): item_name = 'rhn-package-conflicts-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
class ProvidesItem(BaseItem): item_name = 'rhn-package-provides-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
|
addItem(ConflictsItem) | addItem(ProvidesItem) | |
class ObsoletesItem(BaseItem): item_name = 'rhn-package-obsoletes-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
class RequiresItem(BaseItem): item_name = 'rhn-package-requires-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
|
addItem(ObsoletesItem) | addItem(RequiresItem) |
Clone # 57
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 953 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 918 | |
class PackagesDumper(CachedDumper, exportLib.PackagesDumper): def __init__(self, writer, packages): h = rhnSQL.prepare("\n select \n p.id, \n p.org_id,\n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n pg.name package_group, \n p.rpm_version, \n p.description,\n p.summary,\n p.package_size,\n p.payload_size,\n p.build_host, \n TO_CHAR(p.build_time, 'YYYYMMDDHH24MISS') build_time,\n sr.name source_rpm, \n c.checksum_type,\n c.checksum,\n p.vendor,\n p.payload_format, \n p.compat, \n p.header_sig,\n p.header_start,\n p.header_end,\n p.copyright,\n p.cookie,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c\n where p.id = :package_id \n and p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.package_group = pg.id\n and p.source_rpm_id = sr.id\n and p.checksum_id = c.id\n ") CachedDumper.__init__(self, writer, statement=h, params=packages) def _get_key(self, params): package_id = str(params['package_id']) hash_val = rhnLib.hash_object_id(package_id, 2) return ('xml-packages/%s/rhn-package-%s.xml') % ((hash_val, package_id)) def _dump_subelement(self, data): log_debug(6, data) return exportLib.PackagesDumper.dump_subelement(self, data) |
class ShortPackagesDumper(CachedDumper, exportLib.ShortPackagesDumper): def __init__(self, writer, packages): h = rhnSQL.prepare("\n select \n p.id,\n p.org_id,\n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n c.checksum_type,\n c.checksum,\n p.package_size,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnChecksumView c\n where p.id = :package_id \n and p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.checksum_id = c.id\n ") CachedDumper.__init__(self, writer, statement=h, params=packages) def _get_key(self, params): package_id = str(params['package_id']) hash_val = rhnLib.hash_object_id(package_id, 2) return ('xml-short-packages/%s/rhn-package-short-%s.xml') % ((hash_val, package_id)) def _dump_subelement(self, data): log_debug(6, data) return exportLib.ShortPackagesDumper.dump_subelement(self, data) |
Clone # 58
Distance between two fragments = 3
Clone size = 12
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 1006 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 953 | |
class SourcePackagesDumper(CachedDumper, exportLib.SourcePackagesDumper): def __init__(self, writer, packages): h = rhnSQL.prepare("\n select \n ps.id, \n sr.name source_rpm, \n pg.name package_group, \n ps.rpm_version, \n ps.payload_size,\n ps.build_host, \n TO_CHAR(ps.build_time, 'YYYYMMDDHH24MISS') build_time,\n sig.checksum sigchecksum,\n sig.checksum_type sigchecksum_type,\n ps.vendor,\n ps.cookie,\n ps.package_size,\n c.checksum_type,\n c.checksum,\n TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackageSource ps, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c, rhnChecksumView sig\n where ps.id = :package_id\n and ps.package_group = pg.id\n and ps.source_rpm_id = sr.id\n and ps.checksum_id = c.id\n and ps.sigchecksum_id = sig.id\n ") CachedDumper.__init__(self, writer, statement=h, params=packages) def _get_key(self, params): package_id = str(params['package_id']) hash_val = rhnLib.hash_object_id(package_id, 2) return ('xml-packages/%s/rhn-source-package-%s.xml') % ((hash_val, package_id)) def _dump_subelement(self, data): log_debug(6, data) return exportLib.SourcePackagesDumper.dump_subelement(self, data) |
class PackagesDumper(CachedDumper, exportLib.PackagesDumper): def __init__(self, writer, packages): h = rhnSQL.prepare("\n select \n p.id, \n p.org_id,\n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n pg.name package_group, \n p.rpm_version, \n p.description,\n p.summary,\n p.package_size,\n p.payload_size,\n p.build_host, \n TO_CHAR(p.build_time, 'YYYYMMDDHH24MISS') build_time,\n sr.name source_rpm, \n c.checksum_type,\n c.checksum,\n p.vendor,\n p.payload_format, \n p.compat, \n p.header_sig,\n p.header_start,\n p.header_end,\n p.copyright,\n p.cookie,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c\n where p.id = :package_id \n and p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.package_group = pg.id\n and p.source_rpm_id = sr.id\n and p.checksum_id = c.id\n ") CachedDumper.__init__(self, writer, statement=h, params=packages) def _get_key(self, params): package_id = str(params['package_id']) hash_val = rhnLib.hash_object_id(package_id, 2) return ('xml-packages/%s/rhn-package-%s.xml') % ((hash_val, package_id)) def _dump_subelement(self, data): log_debug(6, data) return exportLib.PackagesDumper.dump_subelement(self, data) |
Clone # 59
Distance between two fragments = 3
Clone size = 13
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 1006 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 918 | |
class SourcePackagesDumper(CachedDumper, exportLib.SourcePackagesDumper): def __init__(self, writer, packages): h = rhnSQL.prepare("\n select \n ps.id, \n sr.name source_rpm, \n pg.name package_group, \n ps.rpm_version, \n ps.payload_size,\n ps.build_host, \n TO_CHAR(ps.build_time, 'YYYYMMDDHH24MISS') build_time,\n sig.checksum sigchecksum,\n sig.checksum_type sigchecksum_type,\n ps.vendor,\n ps.cookie,\n ps.package_size,\n c.checksum_type,\n c.checksum,\n TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackageSource ps, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c, rhnChecksumView sig\n where ps.id = :package_id\n and ps.package_group = pg.id\n and ps.source_rpm_id = sr.id\n and ps.checksum_id = c.id\n and ps.sigchecksum_id = sig.id\n ") CachedDumper.__init__(self, writer, statement=h, params=packages) def _get_key(self, params): package_id = str(params['package_id']) hash_val = rhnLib.hash_object_id(package_id, 2) return ('xml-packages/%s/rhn-source-package-%s.xml') % ((hash_val, package_id)) def _dump_subelement(self, data): log_debug(6, data) return exportLib.SourcePackagesDumper.dump_subelement(self, data) |
class ShortPackagesDumper(CachedDumper, exportLib.ShortPackagesDumper): def __init__(self, writer, packages): h = rhnSQL.prepare("\n select \n p.id,\n p.org_id,\n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n c.checksum_type,\n c.checksum,\n p.package_size,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnChecksumView c\n where p.id = :package_id \n and p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.checksum_id = c.id\n ") CachedDumper.__init__(self, writer, statement=h, params=packages) def _get_key(self, params): package_id = str(params['package_id']) hash_val = rhnLib.hash_object_id(package_id, 2) return ('xml-short-packages/%s/rhn-package-short-%s.xml') % ((hash_val, package_id)) def _dump_subelement(self, data): log_debug(6, data) return exportLib.ShortPackagesDumper.dump_subelement(self, data) |
Clone # 60
Distance between two fragments = 2
Clone size = 12
Source file "./server/rhnChannel.py" The first line is 1246 | Source file "./server/rhnChannel.py" The first line is 1173 | |
def list_all_packages_sql(channel_id): log_debug(3, channel_id) h = rhnSQL.prepare('\n select\n pn.name, \n pevr.version, \n pevr.release, \n pevr.epoch, \n pa.label arch, \n p.package_size \n from \n rhnChannelPackage cp,\n rhnPackage p,\n rhnPackageName pn,\n rhnPackageEVR pevr,\n rhnPackageArch pa\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n and p.name_id = pn.id\n and p.evr_id = pevr.id\n and p.package_arch_id = pa.id\n order by pn.name, pevr.evr desc, pa.label\n ') h.execute(channel_id=str(channel_id)) ret = h.fetchall_dict() if not ret: return [] ret = map(lambda a: (a['name'], a['version'], a['release'], a['epoch'], a['arch'], a['package_size']), __stringify(ret)) return ret |
def list_packages_sql(channel_id): log_debug(3, channel_id) h = rhnSQL.prepare("\n select\n pn.name, \n pevr.version, \n pevr.release, \n pevr.epoch, \n pa.label arch, \n full_channel.package_size \n from \n rhnPackageArch pa,\n ( select \n p.name_id,\n max(pe.evr) evr\n from\n rhnChannelPackage cp,\n rhnPackage p,\n rhnPackageEVR pe\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n and p.evr_id = pe.id\n group by p.name_id\n ) listall,\n ( select distinct\n p.package_size,\n p.name_id,\n p.evr_id,\n p.package_arch_id\n from\n rhnChannelPackage cp,\n rhnPackage p\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n ) full_channel,\n -- Rank the package's arch\n ( select\n package_arch_id, \n count(*) rank\n from\n rhnServerPackageArchCompat\n group by package_arch_id\n ) arch_rank,\n rhnPackageName pn,\n rhnPackageEVR pevr\n where\n pn.id = listall.name_id\n -- link back to the specific package\n and full_channel.name_id = listall.name_id\n and full_channel.evr_id = pevr.id\n and pevr.evr = listall.evr\n and pa.id = full_channel.package_arch_id\n and pa.id = arch_rank.package_arch_id\n order by pn.name, arch_rank.rank desc\n ") h.execute(channel_id=str(channel_id)) ret = h.fetchall_dict() if not ret: return [] ret = map(lambda a: (a['name'], a['version'], a['release'], a['epoch'], a['arch'], a['package_size']), __stringify(ret)) return ret |
Clone # 61
Distance between two fragments = 1
Clone size = 12
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 112 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 72 | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.Channel() | |
c.load_from_dict(vdict) | c.load_from_dict(vdict) | |
c.save() | c.save() | |
channel_id = c.get_id() | channel_id = c.get_id() | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.Channel() | |
c.load_by_label(label) | c.load_by_label(label) | |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
|
rhnSQL.commit() | rhnSQL.commit() | |
return c | return c |
Clone # 62
Distance between two fragments = 0
Clone size = 12
Source file "./satellite_tools/test/test-iconv.py" The first line is 41 | Source file "./common/rhn_memusage.py" The first line is 18 | |
def mem_usage(): f = open('/proc/self/status') dict = {} while 1: line = f.readline() if not line: break arr = map(string.strip, string.split(line, ':', 1)) if len(arr) == 1: continue dict[arr[0]] = arr[1] return (dict['Name'], dict['VmSize'], dict['VmRSS'], dict['VmData']) |
def mem_usage(): f = open('/proc/self/status') dict = {} while 1: line = f.readline() if not line: break arr = map(string.strip, string.split(line, ':', 1)) if len(arr) == 1: continue dict[arr[0]] = arr[1] return (dict['Name'], dict['VmSize'], dict['VmRSS'], dict['VmData']) |
Clone # 63
Distance between two fragments = 0
Clone size = 12
Source file "./satellite_tools/test/test-iconv.py" The first line is 41 | Source file "./server/test/test-cx_Oracle-memleak.py" The first line is 24 | |
def mem_usage(): f = open('/proc/self/status') dict = {} while 1: line = f.readline() if not line: break arr = map(string.strip, string.split(line, ':', 1)) if len(arr) == 1: continue dict[arr[0]] = arr[1] return (dict['Name'], dict['VmSize'], dict['VmRSS'], dict['VmData']) |
def mem_usage(): f = open('/proc/self/status') dict = {} while 1: line = f.readline() if not line: break arr = map(string.strip, string.split(line, ':', 1)) if len(arr) == 1: continue dict[arr[0]] = arr[1] return (dict['Name'], dict['VmSize'], dict['VmRSS'], dict['VmData']) |
Clone # 64
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 189 | Source file "./satellite_tools/diskImportLib.py" The first line is 182 | |
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerPackageArchCompatContainer(xmlSource.ServerPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ChannelPackageArchCompatContainer(xmlSource.ChannelPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ChannelPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 65
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 196 | Source file "./satellite_tools/diskImportLib.py" The first line is 182 | |
class ChannelPackageArchCompatContainer(xmlSource.ChannelPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ChannelPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerPackageArchCompatContainer(xmlSource.ServerPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerGroupServerArchCompatContainer(xmlSource.ServerGroupServerArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerGroupServerArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 66
Distance between two fragments = 2
Clone size = 12
Source file "./test/non-unit/server/rhnSQL/dbtests.py" The first line is 237 | Source file "./test/non-unit/server/rhnSQL/dbtests.py" The first line is 199 | |
QUERY_CREATE_TABLE = '\n CREATE TABLE %s(id NUMBER, name VARCHAR2(256), num NUMBER(5,2))\n ' | QUERY_CREATE_TABLE = '\n CREATE TABLE %s(id INT, name TEXT, num NUMERIC(5,2))\n ' | |
SIMPLE_PROCEDURE = '\nCREATE OR REPLACE FUNCTION \n return_int(returnme in integer) \nRETURN INTEGER AS\nBEGIN\n RETURN returnme;\nEND;\n ' | SIMPLE_PROCEDURE = "\nCREATE OR REPLACE FUNCTION return_int(returnme INTEGER) RETURNS int AS $$\nDECLARE\n myInt int;\nBEGIN\n myInt := returnme;\n RETURN myInt;\nEND\n$$ LANGUAGE 'plpgsql';\n " | |
def setUp(self): self.temp_table = ('testtable%s') % (randint(1, 10000000)) create_table_query = (self.QUERY_CREATE_TABLE) % (self.temp_table) cursor = rhnSQL.prepare(create_table_query) cursor.execute() RhnSQLDatabaseTests.setUp(self) cursor = rhnSQL.prepare(self.SIMPLE_PROCEDURE) cursor.execute() |
def setUp(self): self.temp_table = ('testtable%s') % (randint(1, 10000000)) create_table_query = (self.QUERY_CREATE_TABLE) % (self.temp_table) cursor = rhnSQL.prepare(create_table_query) cursor.execute() RhnSQLDatabaseTests.setUp(self) cursor = rhnSQL.prepare(self.SIMPLE_PROCEDURE) cursor.execute() |
Clone # 67
Distance between two fragments = 1
Clone size = 12
Source file "./server/handlers/app/packages.py" The first line is 216 | Source file "./server/handlers/xp/packages.py" The first line is 74 | |
authobj.authzChannels(channelList) | authobj.authzChannels(channelList) | |
h = rhnSQL.prepare('\n select sr.name source_rpm\n from rhnChannel c,\n rhnChannelNewestPackage cnp, \n rhnPackage p,\n rhnSourceRPM sr\n where cnp.channel_id = c.id\n and c.label = :channel_label\n and cnp.package_id = p.id\n and p.source_rpm_id = sr.id\n minus\n select sr.name source_rpm\n from rhnChannel c,\n rhnChannelNewestPackage cnp,\n rhnPackage p,\n rhnSourceRPM sr,\n rhnPackageSource ps\n where cnp.channel_id = c.id\n and c.label = :channel_label\n and cnp.package_id = p.id\n and p.source_rpm_id = sr.id\n and p.source_rpm_id = ps.source_rpm_id\n and (p.org_id = ps.org_id or\n (p.org_id is null and ps.org_id is null)\n )\n ') | h = rhnSQL.prepare('\n select sr.name source_rpm\n from rhnChannel c,\n rhnChannelNewestPackage cnp,\n rhnPackage p,\n rhnSourceRPM sr\n where cnp.channel_id = c.id\n and c.label = :channel_label\n and cnp.package_id = p.id\n and p.source_rpm_id = sr.id\n minus\n select sr.name source_rpm\n from rhnChannel c,\n rhnChannelNewestPackage cnp,\n rhnPackage p,\n rhnSourceRPM sr,\n rhnPackageSource ps\n where cnp.channel_id = c.id\n and c.label = :channel_label\n and cnp.package_id = p.id\n and p.source_rpm_id = sr.id\n and p.source_rpm_id = ps.source_rpm_id\n and (p.org_id = ps.org_id or\n (p.org_id is null and ps.org_id is null)\n )\n ') | |
missing_packages = [] | missing_packages = [] | |
for c in channelList: h.execute(channel_label=c) while 1: row = h.fetchone_dict() if not row: break missing_packages.append([row['source_rpm'], c]) |
for c in channelList: h.execute(channel_label=c) while 1: row = h.fetchone_dict() if not row: break missing_packages.append([row['source_rpm'], c]) |
|
return missing_packages | return missing_packages |
Clone # 68
Distance between two fragments = 3
Clone size = 12
Source file "./satellite_tools/satsync.py" The first line is 1702 | Source file "./satellite_tools/satsync.py" The first line is 1104 | |
package_count = len(packages) | package_count = len(pids) | |
log(1, (messages.package_importing) % ((channel, (package_count) or ('NONE RELEVANT')))) | log(1, (messages.package_parsing) % ((channel, (package_count) or ('NONE RELEVANT')))) | |
if not package_count: continue |
if not package_count: continue |
|
log(1, messages.warning_slow) | log(1, messages.warning_slow) | |
pb = ProgressBar(prompt='Importing: ', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
ss = SequenceServer(packages[:], nevermorethan=self._batch_size) | ss = SequenceServer(pids[:], nevermorethan=self._batch_size) |
Clone # 69
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 29 | Source file "./server/test/byterangetests.py" The first line is 21 | |
def testNoRangeGroups(self): try: server.byterange.parse_byteranges('bytes=') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testEmptyRange(self): try: server.byterange.parse_byteranges('') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testNegativeStart(self): try: server.byterange.parse_byteranges('bytes=-1-30') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoRangeGroups(self): try: server.byterange.parse_byteranges('bytes=') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 70
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 44 | Source file "./server/test/byterangetests.py" The first line is 37 | |
def testStartAfterEnd(self): try: server.byterange.parse_byteranges('bytes=12-3') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNegativeStart(self): try: server.byterange.parse_byteranges('bytes=-1-30') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testNoStartOrEnd(self): try: server.byterange.parse_byteranges('bytes=-') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testStartAfterEnd(self): try: server.byterange.parse_byteranges('bytes=12-3') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 71
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 58 | Source file "./server/test/byterangetests.py" The first line is 51 | |
def testNoStartInvalidEnd(self): try: server.byterange.parse_byteranges('bytes=-0') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoStartOrEnd(self): try: server.byterange.parse_byteranges('bytes=-') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testBadCharactersInRange(self): try: server.byterange.parse_byteranges('bytes=2-CB') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoStartInvalidEnd(self): try: server.byterange.parse_byteranges('bytes=-0') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 72
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 37 | Source file "./server/test/byterangetests.py" The first line is 21 | |
def testNegativeStart(self): try: server.byterange.parse_byteranges('bytes=-1-30') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testEmptyRange(self): try: server.byterange.parse_byteranges('') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testStartAfterEnd(self): try: server.byterange.parse_byteranges('bytes=12-3') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoRangeGroups(self): try: server.byterange.parse_byteranges('bytes=') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 73
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 51 | Source file "./server/test/byterangetests.py" The first line is 37 | |
def testNoStartOrEnd(self): try: server.byterange.parse_byteranges('bytes=-') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNegativeStart(self): try: server.byterange.parse_byteranges('bytes=-1-30') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testNoStartInvalidEnd(self): try: server.byterange.parse_byteranges('bytes=-0') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testStartAfterEnd(self): try: server.byterange.parse_byteranges('bytes=12-3') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 74
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 44 | Source file "./server/test/byterangetests.py" The first line is 21 | |
def testStartAfterEnd(self): try: server.byterange.parse_byteranges('bytes=12-3') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testEmptyRange(self): try: server.byterange.parse_byteranges('') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testNoStartOrEnd(self): try: server.byterange.parse_byteranges('bytes=-') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoRangeGroups(self): try: server.byterange.parse_byteranges('bytes=') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 75
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 58 | Source file "./server/test/byterangetests.py" The first line is 37 | |
def testNoStartInvalidEnd(self): try: server.byterange.parse_byteranges('bytes=-0') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNegativeStart(self): try: server.byterange.parse_byteranges('bytes=-1-30') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testBadCharactersInRange(self): try: server.byterange.parse_byteranges('bytes=2-CB') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testStartAfterEnd(self): try: server.byterange.parse_byteranges('bytes=12-3') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 76
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 51 | Source file "./server/test/byterangetests.py" The first line is 21 | |
def testNoStartOrEnd(self): try: server.byterange.parse_byteranges('bytes=-') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testEmptyRange(self): try: server.byterange.parse_byteranges('') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testNoStartInvalidEnd(self): try: server.byterange.parse_byteranges('bytes=-0') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoRangeGroups(self): try: server.byterange.parse_byteranges('bytes=') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 77
Distance between two fragments = 4
Clone size = 12
Source file "./server/test/byterangetests.py" The first line is 58 | Source file "./server/test/byterangetests.py" The first line is 21 | |
def testNoStartInvalidEnd(self): try: server.byterange.parse_byteranges('bytes=-0') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testEmptyRange(self): try: server.byterange.parse_byteranges('') self.fail() except server.byterange.InvalidByteRangeException: pass |
|
def testBadCharactersInRange(self): try: server.byterange.parse_byteranges('bytes=2-CB') self.fail() except server.byterange.InvalidByteRangeException: pass |
def testNoRangeGroups(self): try: server.byterange.parse_byteranges('bytes=') self.fail() except server.byterange.InvalidByteRangeException: pass |
Clone # 78
Distance between two fragments = 3
Clone size = 12
Source file "./server/handlers/app/test/test_channel.py" The first line is 255 | Source file "./server/handlers/app/test/test_channel.py" The first line is 232 | |
def testrevokesubscribeChannelPermission(self): ret = channel.revokeChannelPermission(options['label'], 'subscribe', commit, username, password) h = rhnSQL.prepare('select id from rhnchannel where label = :label') h.execute(label=options['label']) ret = (h.fetchone_dict()) or ([]) h2 = rhnSQL.prepare('\n select cpr.label\n from rhnchannelpermission cp,\n rhnchannelpermissionrole cpr\n where cpr.id = cp.role_id\n and cp.channel_id = :cid\n ') h2.execute(cid=ret['id']) ret2 = (h2.fetchone_dict()) or ([]) if ret2: assert ret2['label'] != 'subscribe' |
def testrevokemanageChannelPermission(self): ret = channel.revokeChannelPermission(options['label'], 'manage', commit, username, password) h = rhnSQL.prepare('select id from rhnchannel where label = :label') h.execute(label=options['label']) ret = (h.fetchone_dict()) or ([]) h2 = rhnSQL.prepare('\n select cpr.label\n from rhnchannelpermission cp,\n rhnchannelpermissionrole cpr\n where cp.channel_id = :cid\n and cpr.id = cp.role_id\n ') h2.execute(cid=ret['id']) ret2 = (h2.fetchone_dict()) or ([]) if ret2: assert ret2['label'] != 'manage' |
Clone # 79
Distance between two fragments = 1
Clone size = 11
Source file "./server/test/test_leak.py" The first line is 29 | Source file "./server/test/test_leak4.py" The first line is 30 | |
while i < 10000: h.execute() if (i) % (100) == 0: f = open('/proc/self/status') l = f.readlines() vmsize = l[10][10:-1] vmrss = l[12][10:-1] f.close() write(('%d %.3f vsz: %s rss: %s \n') % ((i, (time.time()) - (start), vmsize, vmrss))) i = (i) + (1) |
while i < 10000: c.execute() if (i) % (100) == 0: f = open('/proc/self/status') l = f.readlines() vmsize = l[10][10:-1] vmrss = l[12][10:-1] f.close() write(('%d %.3f vsz: %s rss: %s \n') % ((i, (time.time()) - (start), vmsize, vmrss))) i = (i) + (1) |
Clone # 80
Distance between two fragments = 0
Clone size = 11
Source file "./server/test/test_leak.py" The first line is 29 | Source file "./server/test/test_leak2.py" The first line is 29 | |
while i < 10000: h.execute() if (i) % (100) == 0: f = open('/proc/self/status') l = f.readlines() vmsize = l[10][10:-1] vmrss = l[12][10:-1] f.close() write(('%d %.3f vsz: %s rss: %s \n') % ((i, (time.time()) - (start), vmsize, vmrss))) i = (i) + (1) |
while i < 10000: h.execute() if (i) % (100) == 0: f = open('/proc/self/status') l = f.readlines() vmsize = l[10][10:-1] vmrss = l[12][10:-1] f.close() write(('%d %.3f vsz: %s rss: %s \n') % ((i, (time.time()) - (start), vmsize, vmrss))) i = (i) + (1) |
Clone # 81
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 305 | Source file "./server/test/test_solve_dependencies.py" The first line is 292 | |
def testUp2dateFilterGT(self): nlimitstr = '35:mozilla-0-0' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
def testUp2dateFilterEq(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 82
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 366 | Source file "./server/test/test_solve_dependencies.py" The first line is 353 | |
def testUp2dateFilterGT1(self): nlimitstr = 'mozilla-0-0:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
def testUp2dateFilterEq1(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 83
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 329 | Source file "./server/test/test_solve_dependencies.py" The first line is 305 | |
def testUp2dateFilterLT(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterGT(self): nlimitstr = '35:mozilla-0-0' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
Clone # 84
Distance between two fragments = 3
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 341 | Source file "./server/test/test_solve_dependencies.py" The first line is 317 | |
def testUp2dateFilterLTE(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
def testUp2dateFilterGTE(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
Clone # 85
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 353 | Source file "./server/test/test_solve_dependencies.py" The first line is 329 | |
def testUp2dateFilterEq1(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
def testUp2dateFilterLT(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
Clone # 86
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 390 | Source file "./server/test/test_solve_dependencies.py" The first line is 366 | |
def testUp2dateFilterLT1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterGT1(self): nlimitstr = 'mozilla-0-0:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
Clone # 87
Distance between two fragments = 3
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 402 | Source file "./server/test/test_solve_dependencies.py" The first line is 378 | |
def testUp2dateFilterLTE1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
def testUp2dateFilterGTE1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
Clone # 88
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 329 | Source file "./server/test/test_solve_dependencies.py" The first line is 292 | |
def testUp2dateFilterLT(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterEq(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 89
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 366 | Source file "./server/test/test_solve_dependencies.py" The first line is 329 | |
def testUp2dateFilterGT1(self): nlimitstr = 'mozilla-0-0:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
def testUp2dateFilterLT(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
Clone # 90
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 378 | Source file "./server/test/test_solve_dependencies.py" The first line is 341 | |
def testUp2dateFilterGTE1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
def testUp2dateFilterLTE(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
Clone # 91
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 390 | Source file "./server/test/test_solve_dependencies.py" The first line is 353 | |
def testUp2dateFilterLT1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterEq1(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 92
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 353 | Source file "./server/test/test_solve_dependencies.py" The first line is 305 | |
def testUp2dateFilterEq1(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
def testUp2dateFilterGT(self): nlimitstr = '35:mozilla-0-0' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
Clone # 93
Distance between two fragments = 1
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 353 | Source file "./server/test/test_solve_dependencies.py" The first line is 292 | |
def testUp2dateFilterEq1(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
def testUp2dateFilterEq(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 94
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 366 | Source file "./server/test/test_solve_dependencies.py" The first line is 292 | |
def testUp2dateFilterGT1(self): nlimitstr = 'mozilla-0-0:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
def testUp2dateFilterEq(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 95
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 390 | Source file "./server/test/test_solve_dependencies.py" The first line is 305 | |
def testUp2dateFilterLT1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterGT(self): nlimitstr = '35:mozilla-0-0' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 1 |
Clone # 96
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 402 | Source file "./server/test/test_solve_dependencies.py" The first line is 317 | |
def testUp2dateFilterLTE1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
def testUp2dateFilterGTE(self): nlimitstr = '35:mozilla-1-1' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
Clone # 97
Distance between two fragments = 4
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 390 | Source file "./server/test/test_solve_dependencies.py" The first line is 292 | |
def testUp2dateFilterLT1(self): nlimitstr = 'mozilla-1-1:35' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == -1 |
def testUp2dateFilterEq(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert ret == 0 |
Clone # 98
Distance between two fragments = 3
Clone size = 11
Source file "./server/test/test_solve_dependencies.py" The first line is 265 | Source file "./server/test/test_solve_dependencies.py" The first line is 241 | |
def testEvrFilterLTE(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, limit_operator='<=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == -1) or (ret == 0) |
def testEvrFilterGTE(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, limit_operator='>=', limit=nlimitstr) ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) assert (ret == 1) or (ret == 0) |
Clone # 99
Distance between two fragments = 2
Clone size = 11
Source file "./server/handlers/xmlrpc/registration.py" The first line is 909 | Source file "./server/handlers/xmlrpc/registration.py" The first line is 894 | |
def delete_packages(self, system_id, packages): log_debug(5, system_id, packages) if CFG.DISABLE_PACKAGES: return 0 packages = self._normalize_packages(system_id, packages) server = self.auth_system(system_id) log_debug(1, server.getid(), ('packages: %d') % (len(packages))) for package in packages: server.delete_package(package) server.save_packages() return 0 |
def add_packages(self, system_id, packages): log_debug(5, system_id, packages) if CFG.DISABLE_PACKAGES: return 0 packages = self._normalize_packages(system_id, packages) server = self.auth_system(system_id) log_debug(1, server.getid(), ('packages: %d') % (len(packages))) for package in packages: server.add_package(package) server.save_packages() return 0 |
Clone # 100
Distance between two fragments = 1
Clone size = 11
Source file "./server/rhnPackage.py" The first line is 348 | Source file "./server/rhnPackage.py" The first line is 282 | |
rs = h.fetchone_dict() | rs = h.fetchone_dict() | |
if not rs: log_debug(4, 'Error', 'Non-existant package requested', server_id, pkg) raise rhnFault(17, (_('Invalid RPM package %s requested')) % (pkg)) |
if not rs: log_debug(4, 'Error', 'Non-existant package requested', server_id, packageName) raise rhnFault(17, (_('Invalid RPM package %s requested')) % (packageName)) |
|
filePath = ('%s/%s') % ((CFG.MOUNT_POINT, rs['path'])) | filePath = ('%s/%s') % ((CFG.MOUNT_POINT, rs['path'])) | |
if not os.access(filePath, os.R_OK): log_error('Package not found', filePath) raise rhnFault(17, _('Package not found')) |
if not os.access(filePath, os.R_OK): log_error('Package not found', filePath) raise rhnFault(17, _('Package not found')) |
|
rhnFlags.set('Download-Accelerator-Path', rs['path']) | rhnFlags.set('Download-Accelerator-Path', rs['path']) | |
return filePath | return filePath |
Clone # 101
Distance between two fragments = 4
Clone size = 11
Source file "./test/non-unit/server/rhnSQL/dbtests.py" The first line is 173 | Source file "./test/non-unit/server/rhnSQL/dbtests.py" The first line is 160 | |
def test_fetchall_dict(self): query = rhnSQL.prepare(('SELECT * FROM %s ORDER BY id') % (self.temp_table)) query.execute() rows = query.fetchall_dict() self.assertEquals(len(TEST_IDS), len(rows)) i = 0 while i < len(TEST_IDS): self.assertEquals(TEST_IDS[i], rows[i]['id']) self.assertEquals(TEST_NAMES[i], rows[i]['name']) i = (i) + (1) |
def test_fetchall(self): query = rhnSQL.prepare(('SELECT * FROM %s ORDER BY id') % (self.temp_table)) query.execute() rows = query.fetchall() self.assertEquals(len(TEST_IDS), len(rows)) i = 0 while i < len(TEST_IDS): self.assertEquals(TEST_IDS[i], rows[i][0]) self.assertEquals(TEST_NAMES[i], rows[i][1]) i = (i) + (1) |
Clone # 102
Distance between two fragments = 3
Clone size = 11
Source file "./server/action_extra_data/kickstart_guest.py" The first line is 55 | Source file "./server/action_extra_data/kickstart_guest.py" The first line is 38 | |
def initiate(server_id, action_id, data={}): log_debug(3, action_id) action_status = rhnFlags.get('action_status') if action_status == 3: ks_state = 'failed' next_action_type = None else: ks_state = 'in_progress' next_action_type = 'kickstart_guest.add_tools_channel' server_kickstart.update_kickstart_session(server_id, action_id, action_status, kickstart_state=ks_state, next_action_type=next_action_type) |
def add_tools_channel(server_id, action_id, data={}): log_debug(3, action_id) action_status = rhnFlags.get('action_status') if action_status == 3: ks_state = 'failed' next_action_type = None else: ks_state = 'complete' next_action_type = 'kickstart_guest.schedule_virt_guest_pkg_install' server_kickstart.update_kickstart_session(server_id, action_id, action_status, kickstart_state=ks_state, next_action_type=next_action_type) |
Clone # 103
Distance between two fragments = 4
Clone size = 11
Source file "./satellite_tools/exporter/exportLib.py" The first line is 718 | Source file "./satellite_tools/exporter/exportLib.py" The first line is 567 | |
tag_name = 'rhn-packages-short' | tag_name = 'rhn-packages' | |
def set_iterator(self): if self._iterator: return self._iterator h = rhnSQL.prepare("\n select \n p.id, \n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n c.checksum_type,\n c.checksum,\n p.org_id,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnChecksumView c\n where p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.path is not null\n and p.checksum_id = c.id\n and rownum < 3\n ") h.execute() return h |
def set_iterator(self): if self._iterator: return self._iterator h = rhnSQL.prepare("\n select \n p.id,\n p.org_id, \n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n pg.name package_group, \n p.rpm_version, \n p.description,\n p.summary,\n p.package_size,\n p.payload_size,\n p.build_host, \n TO_CHAR(p.build_time, 'YYYYMMDDHH24MISS') build_time,\n sr.name source_rpm, \n c.checksum_type,\n c.checksum,\n p.vendor,\n p.payload_format, \n p.compat, \n p.header_sig,\n p.copyright,\n p.cookie,\n p.header_start,\n p.header_end,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c\n where p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.package_group = pg.id\n and p.source_rpm_id = sr.id\n and p.path is not null\n and p.checksum_id = c.id\n and rownum < 3\n ") h.execute() return h |
|
def dump_subelement(self, data): d = ShortPackageEntryDumper(self._writer, data) d.dump() |
def dump_subelement(self, data): p = _PackageDumper(self._writer, data) p.dump() |
Clone # 104
Distance between two fragments = 3
Clone size = 11
Source file "./server/rhnChannel.py" The first line is 478 | Source file "./server/rhnChannel.py" The first line is 463 | |
_query_update_dists = rhnSQL.Statement('\n update rhnDistChannelMap\n set channel_arch_id = :channel_arch_id,\n os = :os\n where channel_id = :channel_id\n and release = :release\n ') | _query_add_dists = rhnSQL.Statement('\n insert into rhnDistChannelMap \n (channel_id, channel_arch_id, release, os)\n values (:channel_id, :channel_arch_id, :release, :os)\n ') | |
def _update_dists(self, releases, oses): if not releases: return None count = len(releases) channel_ids = ([self._row['id']]) * (count) channel_arch_ids = ([self._row['channel_arch_id']]) * (count) h = rhnSQL.prepare(self._query_update_dists) h.executemany(channel_id=channel_ids, channel_arch_id=channel_arch_ids, release=releases, os=oses) |
def _add_dists(self, releases, oses): if not releases: return None count = len(releases) channel_ids = ([self._row['id']]) * (count) channel_arch_ids = ([self._row['channel_arch_id']]) * (count) h = rhnSQL.prepare(self._query_add_dists) h.executemany(channel_id=channel_ids, channel_arch_id=channel_arch_ids, release=releases, os=oses) |
Clone # 105
Distance between two fragments = 4
Clone size = 10
Source file "./server/importlib/backend.py" The first line is 529 | Source file "./server/importlib/backend.py" The first line is 436 | |
def lookupChannelFamilies(self, hash): if not hash: return None sql = 'select id from rhnChannelFamily where label = :label' h = self.dbmodule.prepare(sql) for k in hash.keys(): h.execute(label=k) row = h.fetchone_dict() if row: hash[k] = row['id'] |
def lookupChecksumTypes(self, checksumTypeHash): if not checksumTypeHash: return None sql = 'select id from rhnChecksumType where label = :label' h = self.dbmodule.prepare(sql) for l in checksumTypeHash.keys(): h.execute(label=l) row = h.fetchone_dict() if row: checksumTypeHash[l] = row['id'] |
Clone # 106
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/sync_handlers.py" The first line is 378 | Source file "./satellite_tools/sync_handlers.py" The first line is 263 | |
class ErrataContainer(xmlSource.ErrataContainer): def endItemCallback(self): xmlSource.ErrataContainer.endItemCallback(self) if not self.batch: return None c = ErrataCollection() c.add_erratum(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class ShortPackageContainer(xmlSource.IncompletePackageContainer): def endItemCallback(self): xmlSource.IncompletePackageContainer.endItemCallback(self) if not self.batch: return None c = ShortPackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
Clone # 107
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/sync_handlers.py" The first line is 263 | Source file "./satellite_tools/sync_handlers.py" The first line is 410 | |
class ShortPackageContainer(xmlSource.IncompletePackageContainer): def endItemCallback(self): xmlSource.IncompletePackageContainer.endItemCallback(self) if not self.batch: return None c = ShortPackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class KickstartableTreesContainer(xmlSource.KickstartableTreesContainer): def endItemCallback(self): xmlSource.KickstartableTreesContainer.endItemCallback(self) if not self.batch: return None c = KickstartableTreesCollection() c.add_item(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
Clone # 108
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/sync_handlers.py" The first line is 263 | Source file "./satellite_tools/sync_handlers.py" The first line is 163 | |
class ShortPackageContainer(xmlSource.IncompletePackageContainer): def endItemCallback(self): xmlSource.IncompletePackageContainer.endItemCallback(self) if not self.batch: return None c = ShortPackageCollection() c.add_package(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
class ChannelContainer(xmlSource.ChannelContainer): def endItemCallback(self): xmlSource.ChannelContainer.endItemCallback(self) if not self.batch: return None c = ChannelCollection() c.add_channel(self.batch[-1]) self.batch[:] def endContainerCallback(self): pass |
Clone # 109
Distance between two fragments = 4
Clone size = 10
Source file "./server/config_common/templated_document.py" The first line is 125 | Source file "./server/config_common/templated_document.py" The first line is 117 | |
def net_intf_netmask(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['netmask'] |
def net_intf_ipaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['ip_addr'] |
|
def net_intf_broadcast(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['broadcast'] |
def net_intf_netmask(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['netmask'] |
Clone # 110
Distance between two fragments = 4
Clone size = 10
Source file "./server/config_common/templated_document.py" The first line is 142 | Source file "./server/config_common/templated_document.py" The first line is 134 | |
def net_intf_hwaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['hw_addr'] |
def net_intf_broadcast(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['broadcast'] |
|
def net_intf_module(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['module'] |
def net_intf_hwaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['hw_addr'] |
Clone # 111
Distance between two fragments = 4
Clone size = 10
Source file "./server/config_common/templated_document.py" The first line is 134 | Source file "./server/config_common/templated_document.py" The first line is 117 | |
def net_intf_broadcast(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['broadcast'] |
def net_intf_ipaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['ip_addr'] |
|
def net_intf_hwaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['hw_addr'] |
def net_intf_netmask(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['netmask'] |
Clone # 112
Distance between two fragments = 4
Clone size = 10
Source file "./server/config_common/templated_document.py" The first line is 142 | Source file "./server/config_common/templated_document.py" The first line is 117 | |
def net_intf_hwaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['hw_addr'] |
def net_intf_ipaddr(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['ip_addr'] |
|
def net_intf_module(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['module'] |
def net_intf_netmask(self, interface_name): iface = self._interface_info(interface_name) if not iface: return None return iface['netmask'] |
Clone # 113
Distance between two fragments = 4
Clone size = 10
Source file "./server/action_extra_data/rollback.py" The first line is 22 | Source file "./server/action_extra_data/packages.py" The first line is 408 | |
def config(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.config: Should do something useful with this data', server_id, action_id, data) |
def refresh_list(server_id, action_id, data={}): if not data: return None log_error('action_extra_data.packages.refresh_list: Should do something useful with this data', server_id, action_id, data) |
|
def listTransactions(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
def delta(server_id, action_id, data={}): if not data: return None log_error('action_extra_data.packages.delta: Should do something useful with this data', server_id, action_id, data) |
Clone # 114
Distance between two fragments = 4
Clone size = 10
Source file "./server/action_extra_data/up2date_config.py" The first line is 23 | Source file "./server/action_extra_data/rollback.py" The first line is 28 | |
def get(server_id, action_id, data={}): if not data: return None log_error('action_error.up2date_config.get: Should do something useful with this data', server_id, action_id, data) |
def listTransactions(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
|
def update(server_id, action_id, data={}): if not data: return None log_error('action_error.up2date_config.update: Should do something useful with this data', server_id, action_id, data) |
def rollback(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
Clone # 115
Distance between two fragments = 4
Clone size = 10
Source file "./server/action_extra_data/up2date_config.py" The first line is 23 | Source file "./server/action_extra_data/rollback.py" The first line is 22 | |
def get(server_id, action_id, data={}): if not data: return None log_error('action_error.up2date_config.get: Should do something useful with this data', server_id, action_id, data) |
def config(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.config: Should do something useful with this data', server_id, action_id, data) |
|
def update(server_id, action_id, data={}): if not data: return None log_error('action_error.up2date_config.update: Should do something useful with this data', server_id, action_id, data) |
def listTransactions(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
Clone # 116
Distance between two fragments = 4
Clone size = 10
Source file "./server/action_extra_data/up2date_config.py" The first line is 23 | Source file "./server/action_extra_data/packages.py" The first line is 408 | |
def get(server_id, action_id, data={}): if not data: return None log_error('action_error.up2date_config.get: Should do something useful with this data', server_id, action_id, data) |
def refresh_list(server_id, action_id, data={}): if not data: return None log_error('action_extra_data.packages.refresh_list: Should do something useful with this data', server_id, action_id, data) |
|
def update(server_id, action_id, data={}): if not data: return None log_error('action_error.up2date_config.update: Should do something useful with this data', server_id, action_id, data) |
def delta(server_id, action_id, data={}): if not data: return None log_error('action_extra_data.packages.delta: Should do something useful with this data', server_id, action_id, data) |
Clone # 117
Distance between two fragments = 3
Clone size = 10
Source file "./server/action_extra_data/rollback.py" The first line is 28 | Source file "./server/action_extra_data/rollback.py" The first line is 22 | |
def listTransactions(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
def config(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.config: Should do something useful with this data', server_id, action_id, data) |
|
def rollback(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
def listTransactions(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
Clone # 118
Distance between two fragments = 4
Clone size = 10
Source file "./server/action_extra_data/rollback.py" The first line is 28 | Source file "./server/action_extra_data/packages.py" The first line is 408 | |
def listTransactions(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
def refresh_list(server_id, action_id, data={}): if not data: return None log_error('action_extra_data.packages.refresh_list: Should do something useful with this data', server_id, action_id, data) |
|
def rollback(server_id, action_id, data={}): if not data: return None log_error('action_error.rollback.listTransactions: Should do something useful with this data', server_id, action_id, data) |
def delta(server_id, action_id, data={}): if not data: return None log_error('action_extra_data.packages.delta: Should do something useful with this data', server_id, action_id, data) |
Clone # 119
Distance between two fragments = 0
Clone size = 10
Source file "./server/rhnDependency.py" The first line is 734 | Source file "./server/rhnDependency.py" The first line is 652 | |
if version > 1: return packages |
if version > 1: return packages |
|
result = [] | result = [] | |
for dep in deplist: if not packages[dep]: continue r = packages[dep][0] if r not in result: result.append(r) |
for dep in deplist: if not packages[dep]: continue r = packages[dep][0] if r not in result: result.append(r) |
|
return result | return result |
Clone # 120
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 439 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 232 | |
def dump_kickstartable_trees(self, kickstart_labels=None): log_debug(2) writer = self._get_xml_writer() dumper = SatelliteDumper(writer, KickstartableTreesDumper(writer, kickstarts=kickstart_labels)) dumper.dump() writer.flush() log_debug(4, 'OK') self.close() return 0 |
def dump_channels(self, channel_labels=None): log_debug(2) writer = self._get_xml_writer() dumper = SatelliteDumper(writer, ChannelsDumper(writer, channels=channel_labels)) dumper.dump() writer.flush() log_debug(4, 'OK') self.close() return 0 |
Clone # 121
Distance between two fragments = 0
Clone size = 10
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 114 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 95 | |
c.save() | c.save() | |
channel_id = c.get_id() | channel_id = c.get_id() | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.ChannelFamily() | |
c.load_by_label(label) | c.load_by_label(label) | |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
|
rhnSQL.commit() | rhnSQL.commit() | |
return c | return c |
Clone # 122
Distance between two fragments = 1
Clone size = 10
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 114 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 51 | |
c.save() | c.save() | |
channel_id = c.get_id() | channel_id = c.get_id() | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.Channel() | |
c.load_by_label(label) | c.load_by_label(label) | |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
|
rhnSQL.commit() | rhnSQL.commit() | |
return c | return c |
Clone # 123
Distance between two fragments = 1
Clone size = 10
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 95 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 74 | |
c.save() | c.save() | |
channel_id = c.get_id() | channel_id = c.get_id() | |
c = rhnChannel.ChannelFamily() | c = rhnChannel.Channel() | |
c.load_by_label(label) | c.load_by_label(label) | |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
|
rhnSQL.commit() | rhnSQL.commit() | |
return c | return c |
Clone # 124
Distance between two fragments = 0
Clone size = 10
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 74 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 51 | |
c.save() | c.save() | |
channel_id = c.get_id() | channel_id = c.get_id() | |
c = rhnChannel.Channel() | c = rhnChannel.Channel() | |
c.load_by_label(label) | c.load_by_label(label) | |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
for k, v in vdict.items(): method = getattr(c, ('get_') + (k)) dbv = method() self.assertEqual(v, dbv) |
|
rhnSQL.commit() | rhnSQL.commit() | |
return c | return c |
Clone # 125
Distance between two fragments = 4
Clone size = 10
Source file "./server/test/unit-test/misc_functions.py" The first line is 128 | Source file "./server/rhnServerGroup.py" The first line is 71 | |
if isinstance(org_id, types.StringType): u = rhnUser.search(org_id) if not u: raise rhnServerGroup.InvalidUserError(org_id) return u.contact['org_id'] |
if isinstance(org_id, types.StringType): u = rhnUser.search(org_id) if not u: raise InvalidUserError(org_id) return u.contact['org_id'] |
|
t = rhnSQL.Table('web_customer', 'id') | t = rhnSQL.Table('web_customer', 'id') | |
row = t[org_id] | row = t[org_id] | |
if not row: raise rhnServerGroup.InvalidOrgError(org_id) |
if not row: raise InvalidOrgError(org_id) |
|
return row['id'] | return row['id'] |
Clone # 126
Distance between two fragments = 4
Clone size = 10
Source file "./server/test/misc_functions.py" The first line is 151 | Source file "./server/rhnServerGroup.py" The first line is 71 | |
if isinstance(org_id, types.StringType): u = rhnUser.search(org_id) if not u: raise rhnServerGroup.InvalidUserError(org_id) return u.contact['org_id'] |
if isinstance(org_id, types.StringType): u = rhnUser.search(org_id) if not u: raise InvalidUserError(org_id) return u.contact['org_id'] |
|
t = rhnSQL.Table('web_customer', 'id') | t = rhnSQL.Table('web_customer', 'id') | |
row = t[org_id] | row = t[org_id] | |
if not row: raise rhnServerGroup.InvalidOrgError(org_id) |
if not row: raise InvalidOrgError(org_id) |
|
return row['id'] | return row['id'] |
Clone # 127
Distance between two fragments = 0
Clone size = 10
Source file "./server/handlers/xmlrpc/errata.py" The first line is 163 | Source file "./server/handlers/xmlrpc/errata.py" The first line is 93 | |
ret = [] | ret = [] | |
while 1: row = h.fetchone_dict() if row is None: break for k in row.keys(): if row[k] is None: row[k] = 'N/A' ret.append(row) |
while 1: row = h.fetchone_dict() if row is None: break for k in row.keys(): if row[k] is None: row[k] = 'N/A' ret.append(row) |
|
return ret | return ret |
Clone # 128
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/satsync.py" The first line is 1223 | Source file "./satellite_tools/satsync.py" The first line is 908 | |
m_channel_source_packages = missing_channel_source_packages[channel_label] = [] | m_channel_packages = missing_channel_packages[channel_label] = [] | |
m_fs_source_packages = missing_fs_source_packages[channel_label] = [] | m_fs_packages = missing_fs_packages[channel_label] = [] | |
pb = ProgressBar(prompt='Diffing: ', endTag=' - complete', finalSize=len(upids), finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Diffing: ', endTag=' - complete', finalSize=len(upids), finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) | |
if not upids: pb.printComplete() continue |
if not upids: pb.printComplete() continue |
Clone # 129
Distance between two fragments = 2
Clone size = 10
Source file "./server/test/unit-test/test_server_registration.py" The first line is 131 | Source file "./server/test/unit-test/test_server_registration.py" The first line is 68 | |
u = self._create_new_user() | u = self._create_new_user() | |
username = u.contact['login'] | username = u.contact['login'] | |
password = u.contact['password'] | password = u.contact['password'] | |
params = build_new_system_params_with_username(username=username, password=password, os_release='2.1AS') | params = build_new_system_params_with_username(username=username, password=password, os_release='2.1AS') | |
system_id = register_new_system(params) | system_id = register_new_system(params) | |
rhnSQL.commit() | rhnSQL.commit() | |
s1 = rhnServer.get(system_id) | s = rhnServer.get(system_id) | |
self.assertNotEqual(s1, None) | self.assertNotEqual(s, None) | |
server_id_1 = s1.getid() | server_id = s.getid() |
Clone # 130
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 81 | Source file "./common/test/unit-test/test_gettext.py" The first line is 74 | |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
def test_en_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
Clone # 131
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 137 | Source file "./common/test/unit-test/test_gettext.py" The first line is 130 | |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
def test_go_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
Clone # 132
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 88 | Source file "./common/test/unit-test/test_gettext.py" The first line is 74 | |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_en_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
Clone # 133
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 144 | Source file "./common/test/unit-test/test_gettext.py" The first line is 130 | |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_go_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
Clone # 134
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 116 | Source file "./common/test/unit-test/test_gettext.py" The first line is 88 | |
def test_ro_3(self): lang = 'ro' s = 'What should I do now?' target = 'Ce sa fac acum?' self._test(lang, s, target) |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
|
def test_ro_missing_1(self): lang = 'ro' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
Clone # 135
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 144 | Source file "./common/test/unit-test/test_gettext.py" The first line is 116 | |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_ro_3(self): lang = 'ro' s = 'What should I do now?' target = 'Ce sa fac acum?' self._test(lang, s, target) |
|
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
def test_ro_missing_1(self): lang = 'ro' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
Clone # 136
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 130 | Source file "./common/test/unit-test/test_gettext.py" The first line is 88 | |
def test_go_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
|
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
Clone # 137
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 130 | Source file "./common/test/unit-test/test_gettext.py" The first line is 81 | |
def test_go_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
|
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
Clone # 138
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 137 | Source file "./common/test/unit-test/test_gettext.py" The first line is 74 | |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
def test_en_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
Clone # 139
Distance between two fragments = 4
Clone size = 10
Source file "./common/test/unit-test/test_gettext.py" The first line is 144 | Source file "./common/test/unit-test/test_gettext.py" The first line is 74 | |
def test_en_3(self): lang = 'en' s = 'What should I do now?' target = s self._test(lang, s, target) |
def test_en_1(self): lang = 'en' s = 'Good day' target = s self._test(lang, s, target) |
|
def test_en_missing_1(self): lang = 'en' s = "This string doesn't exist in the translation" target = s self._test(lang, s, target) |
def test_en_2(self): lang = 'en' s = 'How do you do?' target = s self._test(lang, s, target) |
Clone # 140
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/diskImportLib.py" The first line is 164 | Source file "./satellite_tools/diskImportLib.py" The first line is 158 | |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ChannelArchContainer(xmlSource.ChannelArchContainer): def endContainerCallback(self): importer = archImport.ChannelArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerArchContainer(xmlSource.ServerArchContainer): def endContainerCallback(self): importer = archImport.ServerArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 141
Distance between two fragments = 4
Clone size = 11
Source file "./satellite_tools/diskImportLib.py" The first line is 176 | Source file "./satellite_tools/diskImportLib.py" The first line is 170 | |
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerArchContainer(xmlSource.ServerArchContainer): def endContainerCallback(self): importer = archImport.ServerArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerPackageArchCompatContainer(xmlSource.ServerPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 142
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/diskImportLib.py" The first line is 170 | Source file "./satellite_tools/diskImportLib.py" The first line is 158 | |
class ServerArchContainer(xmlSource.ServerArchContainer): def endContainerCallback(self): importer = archImport.ServerArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ChannelArchContainer(xmlSource.ChannelArchContainer): def endContainerCallback(self): importer = archImport.ChannelArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 143
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 182 | Source file "./satellite_tools/diskImportLib.py" The first line is 170 | |
class ServerPackageArchCompatContainer(xmlSource.ServerPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerArchContainer(xmlSource.ServerArchContainer): def endContainerCallback(self): importer = archImport.ServerArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 144
Distance between two fragments = 4
Clone size = 11
Source file "./satellite_tools/diskImportLib.py" The first line is 176 | Source file "./satellite_tools/diskImportLib.py" The first line is 158 | |
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ChannelArchContainer(xmlSource.ChannelArchContainer): def endContainerCallback(self): importer = archImport.ChannelArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerPackageArchCompatContainer(xmlSource.ServerPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 145
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 189 | Source file "./satellite_tools/diskImportLib.py" The first line is 170 | |
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerArchContainer(xmlSource.ServerArchContainer): def endContainerCallback(self): importer = archImport.ServerArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ChannelPackageArchCompatContainer(xmlSource.ChannelPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ChannelPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 146
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 182 | Source file "./satellite_tools/diskImportLib.py" The first line is 158 | |
class ServerPackageArchCompatContainer(xmlSource.ServerPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ChannelArchContainer(xmlSource.ChannelArchContainer): def endContainerCallback(self): importer = archImport.ChannelArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 147
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 196 | Source file "./satellite_tools/diskImportLib.py" The first line is 170 | |
class ChannelPackageArchCompatContainer(xmlSource.ChannelPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ChannelPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ServerArchContainer(xmlSource.ServerArchContainer): def endContainerCallback(self): importer = archImport.ServerArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerGroupServerArchCompatContainer(xmlSource.ServerGroupServerArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerGroupServerArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class CPUArchContainer(xmlSource.CPUArchContainer): def endContainerCallback(self): importer = archImport.CPUArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 148
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 189 | Source file "./satellite_tools/diskImportLib.py" The first line is 158 | |
class ServerChannelArchCompatContainer(xmlSource.ServerChannelArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerChannelArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ChannelArchContainer(xmlSource.ChannelArchContainer): def endContainerCallback(self): importer = archImport.ChannelArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ChannelPackageArchCompatContainer(xmlSource.ChannelPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ChannelPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 149
Distance between two fragments = 4
Clone size = 12
Source file "./satellite_tools/diskImportLib.py" The first line is 196 | Source file "./satellite_tools/diskImportLib.py" The first line is 158 | |
class ChannelPackageArchCompatContainer(xmlSource.ChannelPackageArchCompatContainer): def endContainerCallback(self): importer = archImport.ChannelPackageArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class ChannelArchContainer(xmlSource.ChannelArchContainer): def endContainerCallback(self): importer = archImport.ChannelArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
|
class ServerGroupServerArchCompatContainer(xmlSource.ServerGroupServerArchCompatContainer): def endContainerCallback(self): importer = archImport.ServerGroupServerArchCompatImport(self.batch, get_backend()) importer.run() self.batch = [] |
class PackageArchContainer(xmlSource.PackageArchContainer): def endContainerCallback(self): importer = archImport.PackageArchImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 150
Distance between two fragments = 3
Clone size = 10
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 644 | Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 346 | |
while 1: buf = stream.read(buffer_size) if not buf: break try: self._raw_stream.write(buf) except IOError: log_error('Client appears to have closed connection') self.close_rpm() raise dumper.ClosedConnectionError |
while 1: buff = stream.read(buffer_size) if not buff: break try: self._raw_stream.write(buff) except IOError: log_error('Client disconnected prematurely') self.close() raise dumper.ClosedConnectionError |
Clone # 151
Distance between two fragments = 1
Clone size = 10
Source file "./server/test/test_solve_dependencies.py" The first line is 367 | Source file "./server/test/test_solve_dependencies.py" The first line is 306 | |
nlimitstr = 'mozilla-0-0:35' | nlimitstr = '35:mozilla-0-0' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | |
assert ret == 1 | assert ret == 1 |
Clone # 152
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/satsync.py" The first line is 1835 | Source file "./satellite_tools/satsync.py" The first line is 1391 | |
errata_count = len(batch) | kt_count = len(ktids) | |
log(1, (messages.errata_importing) % ((chn, (errata_count) or ('NONE RELEVANT')))) | log(1, (messages.kickstart_parsing) % ((channel, (kt_count) or ('NONE RELEVANT')))) | |
if not errata_count: continue |
if not kt_count: continue |
|
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=errata_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=kt_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) |
Clone # 153
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/satsync.py" The first line is 1421 | Source file "./satellite_tools/satsync.py" The first line is 1835 | |
files_count = len(files) | errata_count = len(batch) | |
log(1, (messages.kickstart_downloading) % ((channel, (files_count) or ('NONE RELEVANT')))) | log(1, (messages.errata_importing) % ((chn, (errata_count) or ('NONE RELEVANT')))) | |
if not files_count: continue |
if not errata_count: continue |
|
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=files_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=errata_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) |
Clone # 154
Distance between two fragments = 3
Clone size = 10
Source file "./satellite_tools/satsync.py" The first line is 1421 | Source file "./satellite_tools/satsync.py" The first line is 1391 | |
files_count = len(files) | kt_count = len(ktids) | |
log(1, (messages.kickstart_downloading) % ((channel, (files_count) or ('NONE RELEVANT')))) | log(1, (messages.kickstart_parsing) % ((channel, (kt_count) or ('NONE RELEVANT')))) | |
if not files_count: continue |
if not kt_count: continue |
|
pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=files_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=kt_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) |
Clone # 155
Distance between two fragments = 4
Clone size = 10
Source file "./satellite_tools/satsync.py" The first line is 1704 | Source file "./satellite_tools/satsync.py" The first line is 1282 | |
log(1, (messages.package_importing) % ((channel, (package_count) or ('NONE RELEVANT')))) | log(1, (messages.package_parsing) % ((channel, (package_count) or ('NONE RELEVANT')))) | |
if not package_count: continue |
if not package_count: continue |
|
log(1, messages.warning_slow) | log(1, ' * WARNING: this may be a very slow process.') | |
pb = ProgressBar(prompt='Importing: ', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | pb = ProgressBar(prompt='Downloading:', endTag=' - complete', finalSize=package_count, finalBarLength=40, stream=sys.stdout) | |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
if CFG.DEBUG > 2: pb.redrawYN = 0 |
|
pb.printAll(1) | pb.printAll(1) |
Clone # 156
Distance between two fragments = 0
Clone size = 10
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 556 | Source file "./server/rhnSQL/sql_lib.py" The first line is 96 | |
if len(package) > 3: epoch = package[3] if epoch in ['(none)', 'None', None]: epoch = '' epoch = str(epoch) else: epoch = '' |
if len(package) > 3: epoch = package[3] if epoch in ['(none)', 'None', None]: epoch = '' epoch = str(epoch) else: epoch = '' |
|
name = __check_Int_String('name', name) | name = __check_Int_String('name', name) | |
version = __check_Int_String('version', version) | version = __check_Int_String('version', version) | |
release = __check_Int_String('release', release) | release = __check_Int_String('release', release) | |
return [name, version, release, epoch] | return [name, version, release, epoch] |
Clone # 157
Distance between two fragments = 2
Clone size = 9
Source file "./satellite_tools/satsync.py" The first line is 760 | Source file "./satellite_tools/satsync.py" The first line is 731 | |
channel_object = self._channel_collection.get_channel(clabel, ctimestamp) | channel_object = self._channel_collection.get_channel(plabel, timestamp) | |
assert channel_object is not None | assert channel_object is not None | |
all_pkgs = (channel_object['all-packages']) or (channel_object['packages']) | all_pkgs = (channel_object['all-packages']) or (channel_object['packages']) | |
pkgs_count = len(all_pkgs) | pkgs_count = len(all_pkgs) | |
if clabel in ch_requested_imported: status = 'p' else: status = '.' |
if plabel in ch_requested_imported: status = 'p' else: status = '.' |
|
log(1, (p_format) % ((status, clabel, pkgs_count))) | log(1, (p_format) % ((status, plabel, pkgs_count))) |
Clone # 158
Distance between two fragments = 2
Clone size = 9
Source file "./server/rhnPackage.py" The first line is 312 | Source file "./server/rhnPackage.py" The first line is 119 | |
if pkg[3] == '': epochStatement = 'is NULL' else: epochStatement = '= :epoch' param_dict['epoch'] = pkg[3] |
if pkg[3] == '': epochStatement = 'is NULL' else: epochStatement = '= :epoch' param_dict['epoch'] = pkg[3] |
|
statement = ('\n select\n unique ps.path\n from\n rhnPackage p,\n rhnPackageSource ps,\n rhnPackageName pn,\n rhnPackageEVR pe,\n rhnPackageArch pa,\n rhnChannelPackage cp,\n rhnServerChannel sc\n where\n sc.server_id = :server_id\n and sc.channel_id = cp.channel_id\n and cp.package_id = p.id\n and p.source_rpm_id = ps.source_rpm_id\n and ((p.org_id is null and ps.org_id is null)\n or (p.org_id = ps.org_id))\n and p.name_id = pn.id\n and pn.name = :name\n and p.evr_id = pe.id\n and pe.version = :ver\n and pe.release = :rel\n and pe.epoch %s\n and p.package_arch_id = pa.id\n and pa.label = :arch\n ') % (epochStatement) | statement = ('\n select\n p.id, p.path path, p.package_arch_id\n from\n rhnPackage p,\n rhnPackageName pn,\n rhnPackageEvr pe,\n rhnServerArch sa,\n rhnChannelPackage cp,\n rhnServerPackageArchCompat spac,\n rhnServerChannel sc\n where\n sc.server_id = :server_id\n and sc.channel_id = cp.channel_id\n and cp.package_id = p.id\n and p.name_id = pn.id\n and pn.name = :name\n and p.evr_id = pe.id\n and pe.version = :ver\n and pe.release = :rel\n and pe.epoch %s\n and p.package_arch_id = spac.package_arch_id\n and spac.server_arch_id = sa.id\n and sa.label = :server_arch\n order by spac.preference\n ') % (epochStatement) | |
h = rhnSQL.prepare(statement) | h = rhnSQL.prepare(statement) | |
apply(h.execute, (), param_dict) | apply(h.execute, (), param_dict) | |
rs = h.fetchone_dict() | row = h.fetchone_dict() |
Clone # 159
Distance between two fragments = 2
Clone size = 9
Source file "./test/runtests-postgresql.py" The first line is 46 | Source file "./test/runtests-oracle.py" The first line is 45 | |
def suite(): return unittest.TestSuite((dbtests.postgresql_suite())) |
def suite(): return unittest.TestSuite((dbtests.oracle_suite())) |
|
if __name__ == '__main__': try: import testoob testoob.main(defaultTest='suite') except ImportError: print 'These tests would run prettier if you installed testoob. :)' unittest.main(defaultTest='suite') |
if __name__ == '__main__': try: import testoob testoob.main(defaultTest='suite') except ImportError: print 'These tests would run prettier if you install testoob. :)' unittest.main(defaultTest='suite') |
Clone # 160
Distance between two fragments = 3
Clone size = 9
Source file "./test/runtests-postgresql.py" The first line is 46 | Source file "./test/runtests.py" The first line is 39 | |
def suite(): return unittest.TestSuite((dbtests.postgresql_suite())) |
def suite(): return unittest.TestSuite((rhnsqltests.suite())) |
|
if __name__ == '__main__': try: import testoob testoob.main(defaultTest='suite') except ImportError: print 'These tests would run prettier if you installed testoob. :)' unittest.main(defaultTest='suite') |
if __name__ == '__main__': try: import testoob testoob.main(defaultTest='suite') except ImportError: print 'These tests would run prettier if you install testoob. :)' unittest.main(defaultTest='suite') |
Clone # 161
Distance between two fragments = 2
Clone size = 9
Source file "./test/runtests-oracle.py" The first line is 45 | Source file "./test/runtests.py" The first line is 39 | |
def suite(): return unittest.TestSuite((dbtests.oracle_suite())) |
def suite(): return unittest.TestSuite((rhnsqltests.suite())) |
|
if __name__ == '__main__': try: import testoob testoob.main(defaultTest='suite') except ImportError: print 'These tests would run prettier if you install testoob. :)' unittest.main(defaultTest='suite') |
if __name__ == '__main__': try: import testoob testoob.main(defaultTest='suite') except ImportError: print 'These tests would run prettier if you install testoob. :)' unittest.main(defaultTest='suite') |
Clone # 162
Distance between two fragments = 2
Clone size = 9
Source file "./server/importlib/backend.py" The first line is 1739 | Source file "./server/importlib/backend.py" The first line is 1759 | |
if not hash: return None |
if not hash: return None |
|
tab = self.tables[tname] | tab = self.tables[tname] | |
pks = tab.getPK() | pks = tab.getPK() | |
k = pks[0] | k = pks[0] | |
if not hash[k]: return None |
if not hash[k]: return None |
|
deleteObj = TableDelete(tab, self.dbmodule) | updateObj = TableUpdate(tab, self.dbmodule) | |
deleteObj.query(hash) | updateObj.query(hash) |
Clone # 163
Distance between two fragments = 4
Clone size = 9
Source file "./server/importlib/backend.py" The first line is 530 | Source file "./server/importlib/backend.py" The first line is 254 | |
if not hash: return None |
if not hash: return None |
|
sql = 'select id from rhnChannelFamily where label = :label' | sql = 'select id, channel_arch_id from rhnChannel where label = :label' | |
h = self.dbmodule.prepare(sql) | h = self.dbmodule.prepare(sql) | |
for k in hash.keys(): h.execute(label=k) row = h.fetchone_dict() if row: hash[k] = row['id'] |
for k in hash.keys(): h.execute(label=k) row = h.fetchone_dict() if row: hash[k] = row |
Clone # 164
Distance between two fragments = 3
Clone size = 9
Source file "./server/repomd/repository.py" The first line is 213 | Source file "./server/repomd/repository.py" The first line is 209 | |
def get_other_xml_file(self): xml_file = self.repository.get_other_xml_file() return self.__get_compressed_file(xml_file) |
def get_primary_xml_file(self): xml_file = self.repository.get_primary_xml_file() return self.__get_compressed_file(xml_file) |
|
def get_filelists_xml_file(self): xml_file = self.repository.get_filelists_xml_file() return self.__get_compressed_file(xml_file) |
def get_other_xml_file(self): xml_file = self.repository.get_other_xml_file() return self.__get_compressed_file(xml_file) |
|
def get_updateinfo_xml_file(self): xml_file = self.repository.get_updateinfo_xml_file() return self.__get_compressed_file(xml_file) |
def get_filelists_xml_file(self): xml_file = self.repository.get_filelists_xml_file() return self.__get_compressed_file(xml_file) |
Clone # 165
Distance between two fragments = 4
Clone size = 9
Source file "./satellite_tools/xmlDiskDumper.py" The first line is 367 | Source file "./satellite_tools/xmlDiskDumper.py" The first line is 228 | |
_loader_class = xmlSource.KickstartableTreesContainer | _loader_class = xmlSource.IncompletePackageContainer | |
def setMixin(self): self._mixin = xmlDiskSource.KickstartDataDiskSource(self.mountPoint) |
def setMixin(self): self._mixin = xmlDiskSource.ShortPackageDiskSource(self.mountPoint) |
|
def setID(self, ks_label): return self._mixin.setID(ks_label) |
def setID(self, id): return self._mixin.setID(id) |
|
def _getMethod(self): return self.server.dump.kickstartable_trees |
def _getMethod(self): return self.server.dump.packages_short |
|
def _getArgs(self): return ([self._mixin.id]) |
def _getArgs(self): return ([self._mixin.id]) |
Clone # 166
Distance between two fragments = 2
Clone size = 9
Source file "./server/repomd/view.py" The first line is 233 | Source file "./server/repomd/view.py" The first line is 197 | |
def write_start(self): output = (((XML_ENCODING) + ('\n')) + (' self.fileobj.write(output) |
def write_start(self): output = (((XML_ENCODING) + ('\n')) + (' self.fileobj.write(output) |
|
def write_package(self, package): self.fileobj.write('\n'.join(self._get_package(package))) |
def write_package(self, package): self.fileobj.write('\n'.join(self._get_package(package))) |
|
def write_end(self): self.fileobj.write('') |
def write_end(self): self.fileobj.write('') |
Clone # 167
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 169 | Source file "./server/action/virt.py" The first line is 158 | |
def shutdown(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_shutdown, action_id) except NoRowFoundException: raise InvalidAction('No shutdown actions found.') except NoUUIDException: raise InvalidAction(('Shutdown action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def start(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_start, action_id) except NoRowFoundException: raise InvalidAction('No start actions found.') except NoUUIDException: raise InvalidAction(('Start action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 168
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 180 | Source file "./server/action/virt.py" The first line is 169 | |
def suspend(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_suspend, action_id) except NoRowFoundException: raise InvalidAction('No suspend actions found.') except NoUUIDException: raise InvalidAction(('Suspend action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def shutdown(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_shutdown, action_id) except NoRowFoundException: raise InvalidAction('No shutdown actions found.') except NoUUIDException: raise InvalidAction(('Shutdown action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 169
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 192 | Source file "./server/action/virt.py" The first line is 180 | |
def resume(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_resume, action_id) except NoRowFoundException: raise InvalidAction('No resume actions found.') except NoUUIDException: raise InvalidAction(('Resume action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def suspend(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_suspend, action_id) except NoRowFoundException: raise InvalidAction('No suspend actions found.') except NoUUIDException: raise InvalidAction(('Suspend action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 170
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 203 | Source file "./server/action/virt.py" The first line is 192 | |
def reboot(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_reboot, action_id) except NoRowFoundException: raise InvalidAction('No reboot actions found.') except NoUUIDException: raise InvalidAction(('Reboot action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def resume(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_resume, action_id) except NoRowFoundException: raise InvalidAction('No resume actions found.') except NoUUIDException: raise InvalidAction(('Resume action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 171
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 214 | Source file "./server/action/virt.py" The first line is 203 | |
def destroy(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_destroy, action_id) except NoRowFoundException: raise InvalidAction('No destroy actions found.') except NoUUIDException: raise InvalidAction(('Destroy action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def reboot(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_reboot, action_id) except NoRowFoundException: raise InvalidAction('No reboot actions found.') except NoUUIDException: raise InvalidAction(('Reboot action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 172
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 180 | Source file "./server/action/virt.py" The first line is 158 | |
def suspend(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_suspend, action_id) except NoRowFoundException: raise InvalidAction('No suspend actions found.') except NoUUIDException: raise InvalidAction(('Suspend action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def start(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_start, action_id) except NoRowFoundException: raise InvalidAction('No start actions found.') except NoUUIDException: raise InvalidAction(('Start action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 173
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 192 | Source file "./server/action/virt.py" The first line is 169 | |
def resume(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_resume, action_id) except NoRowFoundException: raise InvalidAction('No resume actions found.') except NoUUIDException: raise InvalidAction(('Resume action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def shutdown(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_shutdown, action_id) except NoRowFoundException: raise InvalidAction('No shutdown actions found.') except NoUUIDException: raise InvalidAction(('Shutdown action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 174
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 203 | Source file "./server/action/virt.py" The first line is 180 | |
def reboot(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_reboot, action_id) except NoRowFoundException: raise InvalidAction('No reboot actions found.') except NoUUIDException: raise InvalidAction(('Reboot action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def suspend(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_suspend, action_id) except NoRowFoundException: raise InvalidAction('No suspend actions found.') except NoUUIDException: raise InvalidAction(('Suspend action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 175
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 214 | Source file "./server/action/virt.py" The first line is 192 | |
def destroy(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_destroy, action_id) except NoRowFoundException: raise InvalidAction('No destroy actions found.') except NoUUIDException: raise InvalidAction(('Destroy action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def resume(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_resume, action_id) except NoRowFoundException: raise InvalidAction('No resume actions found.') except NoUUIDException: raise InvalidAction(('Resume action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 176
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 192 | Source file "./server/action/virt.py" The first line is 158 | |
def resume(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_resume, action_id) except NoRowFoundException: raise InvalidAction('No resume actions found.') except NoUUIDException: raise InvalidAction(('Resume action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def start(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_start, action_id) except NoRowFoundException: raise InvalidAction('No start actions found.') except NoUUIDException: raise InvalidAction(('Start action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 177
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 203 | Source file "./server/action/virt.py" The first line is 169 | |
def reboot(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_reboot, action_id) except NoRowFoundException: raise InvalidAction('No reboot actions found.') except NoUUIDException: raise InvalidAction(('Reboot action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def shutdown(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_shutdown, action_id) except NoRowFoundException: raise InvalidAction('No shutdown actions found.') except NoUUIDException: raise InvalidAction(('Shutdown action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 178
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 214 | Source file "./server/action/virt.py" The first line is 180 | |
def destroy(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_destroy, action_id) except NoRowFoundException: raise InvalidAction('No destroy actions found.') except NoUUIDException: raise InvalidAction(('Destroy action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def suspend(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_suspend, action_id) except NoRowFoundException: raise InvalidAction('No suspend actions found.') except NoUUIDException: raise InvalidAction(('Suspend action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 179
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 203 | Source file "./server/action/virt.py" The first line is 158 | |
def reboot(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_reboot, action_id) except NoRowFoundException: raise InvalidAction('No reboot actions found.') except NoUUIDException: raise InvalidAction(('Reboot action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def start(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_start, action_id) except NoRowFoundException: raise InvalidAction('No start actions found.') except NoUUIDException: raise InvalidAction(('Start action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 180
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 214 | Source file "./server/action/virt.py" The first line is 169 | |
def destroy(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_destroy, action_id) except NoRowFoundException: raise InvalidAction('No destroy actions found.') except NoUUIDException: raise InvalidAction(('Destroy action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def shutdown(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_shutdown, action_id) except NoRowFoundException: raise InvalidAction('No shutdown actions found.') except NoUUIDException: raise InvalidAction(('Shutdown action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 181
Distance between two fragments = 4
Clone size = 9
Source file "./server/action/virt.py" The first line is 214 | Source file "./server/action/virt.py" The first line is 158 | |
def destroy(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_destroy, action_id) except NoRowFoundException: raise InvalidAction('No destroy actions found.') except NoUUIDException: raise InvalidAction(('Destroy action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
def start(server_id, action_id): log_debug(3) try: uuid = _get_uuid(_query_start, action_id) except NoRowFoundException: raise InvalidAction('No start actions found.') except NoUUIDException: raise InvalidAction(('Start action %s has no uuid associated with it.') % (str(action_id))) return (uuid) |
Clone # 182
Distance between two fragments = 0
Clone size = 9
Source file "./spacewalk/common/rhn_mpm.py" The first line is 41 | Source file "./server/handlers/app/rhn_mpm.py" The first line is 38 | |
if (filename is None) and (file is None) and (fd is None): raise ValueError, 'No parameters passed' |
if (filename is None) and (file is None) and (fd is None): raise ValueError, 'No parameters passed' |
|
if filename is not None: f = open(filename) elif file is not None: f = file else: f = os.fdopen(os.dup(fd), 'r') |
if filename is not None: f = open(filename) elif file is not None: f = file else: f = os.fdopen(os.dup(fd), 'r') |
|
f.seek(0, 0) | f.seek(0, 0) | |
p = MPM_Package() | p = MPM_Package() |
Clone # 183
Distance between two fragments = 1
Clone size = 9
Source file "./server/rhnDependency.py" The first line is 720 | Source file "./server/rhnDependency.py" The first line is 635 | |
if len(dict) > 1: matches = dict.keys() compats = filter(lambda a: a[:7] == 'compat-', matches) if (len(compats) > 0) and (len(compats) < len(matches)): for p in compats: dict[p] |
if len(dict) > 1: matches = dict.keys() compats = filter(lambda a: a[:7] == 'compat-', matches) if (len(compats) > 0) and (len(compats) < len(matches)): for p in compats: dict[p] |
|
l = dict.values() | list_of_tuples = dict.values() | |
l.sort(lambda a, b: cmp(a[1], b[1])) | list_of_tuples.sort(lambda a, b: cmp(a[1], b[1])) | |
packages[dep] = map(lambda x: x[0], l) | packages[dep] = map(lambda x: x[0], list_of_tuples) |
Clone # 184
Distance between two fragments = 0
Clone size = 9
Source file "./common/rhnTB.py" The first line is 54 | Source file "./server/handlers/config/test/test_template1.py" The first line is 38 | |
stack = [] | stack = [] | |
while 1: if not tb.tb_next: break tb = tb.tb_next |
while 1: if not tb.tb_next: break tb = tb.tb_next |
|
f = tb.tb_frame | f = tb.tb_frame | |
while f: stack.append(f) f = f.f_back |
while f: stack.append(f) f = f.f_back |
Clone # 185
Distance between two fragments = 2
Clone size = 9
Source file "./satellite_tools/sync_handlers.py" The first line is 339 | Source file "./satellite_tools/sync_handlers.py" The first line is 224 | |
_shared_state = {} | _shared_state = {} | |
def __init__(self): self.__dict__ = self._shared_state if not self._shared_state.keys(): self._errata_hash = {} self._cache = None self._init_cache() |
def __init__(self): self.__dict__ = self._shared_state if not self._shared_state.keys(): self._packages_hash = {} self._cache = None self._init_cache() |
|
def _init_cache(self): self._cache = syncCache.ErratumCache() |
def _init_cache(self): self._cache = syncCache.ShortPackageCache() |
Clone # 186
Distance between two fragments = 3
Clone size = 9
Source file "./server/handlers/app/test/test_channel.py" The first line is 256 | Source file "./server/handlers/app/test/test_channel.py" The first line is 211 | |
ret = channel.revokeChannelPermission(options['label'], 'subscribe', commit, username, password) | ret2 = channel.channelManagePermission(options['label'], 'subscribe', commit, username, password) | |
h = rhnSQL.prepare('select id from rhnchannel where label = :label') | h = rhnSQL.prepare('select id from rhnchannel where label = :label') | |
h.execute(label=options['label']) | h.execute(label=options['label']) | |
ret = (h.fetchone_dict()) or ([]) | ret = (h.fetchone_dict()) or ([]) | |
h2 = rhnSQL.prepare('\n select cpr.label\n from rhnchannelpermission cp,\n rhnchannelpermissionrole cpr\n where cpr.id = cp.role_id\n and cp.channel_id = :cid\n ') | h2 = rhnSQL.prepare('\n select cpr.label\n from rhnchannelpermission cp,\n rhnchannelpermissionrole cpr\n where cp.channel_id = :cid\n and cpr.id = cp.role_id\n ') | |
h2.execute(cid=ret['id']) | h2.execute(cid=ret['id']) | |
ret2 = (h2.fetchone_dict()) or ([]) | ret2 = (h2.fetchone_dict()) or ([]) |
Clone # 187
Distance between two fragments = 3
Clone size = 9
Source file "./server/handlers/app/test/test_channel.py" The first line is 233 | Source file "./server/handlers/app/test/test_channel.py" The first line is 211 | |
ret = channel.revokeChannelPermission(options['label'], 'manage', commit, username, password) | ret2 = channel.channelManagePermission(options['label'], 'subscribe', commit, username, password) | |
h = rhnSQL.prepare('select id from rhnchannel where label = :label') | h = rhnSQL.prepare('select id from rhnchannel where label = :label') | |
h.execute(label=options['label']) | h.execute(label=options['label']) | |
ret = (h.fetchone_dict()) or ([]) | ret = (h.fetchone_dict()) or ([]) | |
h2 = rhnSQL.prepare('\n select cpr.label\n from rhnchannelpermission cp,\n rhnchannelpermissionrole cpr\n where cp.channel_id = :cid\n and cpr.id = cp.role_id\n ') | h2 = rhnSQL.prepare('\n select cpr.label\n from rhnchannelpermission cp,\n rhnchannelpermissionrole cpr\n where cp.channel_id = :cid\n and cpr.id = cp.role_id\n ') | |
h2.execute(cid=ret['id']) | h2.execute(cid=ret['id']) | |
ret2 = (h2.fetchone_dict()) or ([]) | ret2 = (h2.fetchone_dict()) or ([]) |
Clone # 188
Distance between two fragments = 4
Clone size = 15
Source file "./satellite_tools/test/test-dump-arches.py" The first line is 25 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 178 | |
e = exportLib.SatelliteDumper(writer, exportLib.ChannelArchesDumper(writer, rpm_arch_type_only=r), exportLib.PackageArchesDumper(writer, rpm_arch_type_only=r), exportLib.ServerArchesDumper(writer, rpm_arch_type_only=r), exportLib.CPUArchesDumper(writer), exportLib.ServerPackageArchCompatDumper(writer, rpm_arch_type_only=r), exportLib.ServerChannelArchCompatDumper(writer, rpm_arch_type_only=r), exportLib.ChannelPackageArchCompatDumper(writer, rpm_arch_type_only=r)) | dumper = SatelliteDumper(writer, exportLib.ChannelArchesDumper(writer, rpm_arch_type_only=rpm_arch_type_only), exportLib.PackageArchesDumper(writer, rpm_arch_type_only=rpm_arch_type_only), exportLib.ServerArchesDumper(writer, rpm_arch_type_only=rpm_arch_type_only), exportLib.CPUArchesDumper(writer), exportLib.ServerPackageArchCompatDumper(writer, rpm_arch_type_only=rpm_arch_type_only), exportLib.ServerChannelArchCompatDumper(writer, rpm_arch_type_only=rpm_arch_type_only), exportLib.ChannelPackageArchCompatDumper(writer, rpm_arch_type_only=rpm_arch_type_only)) | |
e.dump() | dumper.dump() |
Clone # 189
Distance between two fragments = 0
Clone size = 9
Source file "./server/rhnSQL/sql_row.py" The first line is 113 | Source file "./server/rhnSQL/sql_row.py" The first line is 99 | |
ret = h.fetchone_dict() | ret = h.fetchone_dict() | |
self.data = {} | self.data = {} | |
if not ret: self.real = 0 return 0 |
if not ret: self.real = 0 return 0 |
|
for k in ret.keys(): self.data[k] = (ret[k], 0) |
for k in ret.keys(): self.data[k] = (ret[k], 0) |
|
self.real = 1 | self.real = 1 | |
return 1 | return 1 |
Clone # 190
Distance between two fragments = 4
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 149 | Source file "./server/test/test_solve_dependencies.py" The first line is 138 | |
def testAllReturn2(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.7.1', '1.1.el3.dag', '37', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
def testAllReturn1(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.3.1', '0.dag.rhel3', '34', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
Clone # 191
Distance between two fragments = 4
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 160 | Source file "./server/test/test_solve_dependencies.py" The first line is 149 | |
def testAllReturn3(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.5', '2.rhfc1.dag', '38', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
def testAllReturn2(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.7.1', '1.1.el3.dag', '37', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
Clone # 192
Distance between two fragments = 3
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 171 | Source file "./server/test/test_solve_dependencies.py" The first line is 160 | |
def testAllReturn4(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.6', '0.rhfc1.dag', '38', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
def testAllReturn3(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.5', '2.rhfc1.dag', '38', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
Clone # 193
Distance between two fragments = 4
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 160 | Source file "./server/test/test_solve_dependencies.py" The first line is 138 | |
def testAllReturn3(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.5', '2.rhfc1.dag', '38', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
def testAllReturn1(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.3.1', '0.dag.rhel3', '34', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
Clone # 194
Distance between two fragments = 4
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 171 | Source file "./server/test/test_solve_dependencies.py" The first line is 149 | |
def testAllReturn4(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.6', '0.rhfc1.dag', '38', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
def testAllReturn2(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.7.1', '1.1.el3.dag', '37', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
Clone # 195
Distance between two fragments = 4
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 171 | Source file "./server/test/test_solve_dependencies.py" The first line is 138 | |
def testAllReturn4(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.6', '0.rhfc1.dag', '38', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
def testAllReturn1(self): pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, all=1) exp_ret = ['mozilla', '1.3.1', '0.dag.rhel3', '34', 'i386'] if exp_ret in pack[self.filename]: assert 1 else: assert 0 |
Clone # 196
Distance between two fragments = 0
Clone size = 9
Source file "./server/handlers/app/channel.py" The first line is 57 | Source file "./server/handlers/app/comps.py" The first line is 31 | |
def _auth(self, username, password): if not (username) and (password): raise rhnFault(50, 'Missing username/password arguments', explain=0) authobj = auth(username, password) if not authobj: raise rhnFault(50, 'Invalid username/password arguments', explain=0) return authobj |
def _auth(self, username, password): if not (username) and (password): raise rhnFault(50, 'Missing username/password arguments', explain=0) authobj = auth(username, password) if not authobj: raise rhnFault(50, 'Invalid username/password arguments', explain=0) return authobj |
Clone # 197
Distance between two fragments = 1
Clone size = 9
Source file "./server/handlers/xmlrpc/registration.py" The first line is 443 | Source file "./server/handlers/xmlrpc/registration.py" The first line is 403 | |
try: newserv.save(1, channel) except (rhnChannel.SubscriptionCountExceeded, rhnChannel.NoBaseChannelError), channel_error: raise rhnFault(70) except rhnChannel.BaseChannelDeniedError, channel_error: raise rhnFault(71) except server_lib.rhnSystemEntitlementException, e: raise rhnFault(90) |
try: newserv.save(0, channel) except (rhnChannel.SubscriptionCountExceeded, rhnChannel.NoBaseChannelError), channel_error: raise rhnFault(70) except rhnChannel.BaseChannelDeniedError, channel_error: raise rhnFault(71) except server_lib.rhnSystemEntitlementException, e: raise rhnFault(90) |
Clone # 198
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 254 | Source file "./server/test/test_solve_dependencies.py" The first line is 266 | |
nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, limit_operator='<', limit=nlimitstr) | pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, limit_operator='<=', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 199
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 254 | Source file "./server/test/test_solve_dependencies.py" The first line is 242 | |
nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, limit_operator='<', limit=nlimitstr) | pack = self.solve_deps_with_limits(self.serv_id, [self.filename], 2, limit_operator='>=', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 200
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 403 | Source file "./server/test/test_solve_dependencies.py" The first line is 391 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = 'mozilla-1-1:35' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 201
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 403 | Source file "./server/test/test_solve_dependencies.py" The first line is 367 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = 'mozilla-0-0:35' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 202
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 403 | Source file "./server/test/test_solve_dependencies.py" The first line is 354 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 203
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 403 | Source file "./server/test/test_solve_dependencies.py" The first line is 306 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = '35:mozilla-0-0' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 204
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 403 | Source file "./server/test/test_solve_dependencies.py" The first line is 293 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 205
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 379 | Source file "./server/test/test_solve_dependencies.py" The first line is 391 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = 'mozilla-1-1:35' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 206
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 379 | Source file "./server/test/test_solve_dependencies.py" The first line is 367 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = 'mozilla-0-0:35' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 207
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 379 | Source file "./server/test/test_solve_dependencies.py" The first line is 354 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 208
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 379 | Source file "./server/test/test_solve_dependencies.py" The first line is 306 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = '35:mozilla-0-0' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 209
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 379 | Source file "./server/test/test_solve_dependencies.py" The first line is 293 | |
nlimitstr = 'mozilla-1-1:35' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 210
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 342 | Source file "./server/test/test_solve_dependencies.py" The first line is 367 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = 'mozilla-0-0:35' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 211
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 342 | Source file "./server/test/test_solve_dependencies.py" The first line is 354 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 212
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 342 | Source file "./server/test/test_solve_dependencies.py" The first line is 330 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '35:mozilla-1-1' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 213
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 342 | Source file "./server/test/test_solve_dependencies.py" The first line is 306 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '35:mozilla-0-0' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 214
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 342 | Source file "./server/test/test_solve_dependencies.py" The first line is 293 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<=', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 215
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 318 | Source file "./server/test/test_solve_dependencies.py" The first line is 367 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = 'mozilla-0-0:35' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 216
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 318 | Source file "./server/test/test_solve_dependencies.py" The first line is 354 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 217
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 318 | Source file "./server/test/test_solve_dependencies.py" The first line is 330 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '35:mozilla-1-1' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='<', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 218
Distance between two fragments = 1
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 318 | Source file "./server/test/test_solve_dependencies.py" The first line is 306 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '35:mozilla-0-0' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 219
Distance between two fragments = 2
Clone size = 9
Source file "./server/test/test_solve_dependencies.py" The first line is 318 | Source file "./server/test/test_solve_dependencies.py" The first line is 293 | |
nlimitstr = '35:mozilla-1-1' | nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' | |
nlimit = rhnDependency.make_evr(nlimitstr) | nlimit = rhnDependency.make_evr(nlimitstr) | |
pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='>', limit=nlimitstr) | pack = self.up2date.solveDependencies_with_limits(self.myserver.getSystemId(), [self.filename], 2, limit_operator='==', limit=nlimitstr) | |
ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) | ret = rpm.labelCompare((pack[self.filename][0][3], pack[self.filename][0][1], pack[self.filename][0][2]), (nlimit['epoch'], nlimit['version'], nlimit['release'])) |
Clone # 220
Distance between two fragments = 0
Clone size = 9
Source file "./test/non-unit/server/rhnSQL/dbtests.py" The first line is 124 | Source file "./test/non-unit/server/rhnSQL/dbtests.py" The first line is 92 | |
query = rhnSQL.prepare(('SELECT * FROM %s WHERE id >= 1000 ORDER BY ID') % (self.temp_table)) | query = rhnSQL.prepare(('SELECT * FROM %s WHERE id >= 1000 ORDER BY ID') % (self.temp_table)) | |
query.execute() | query.execute() | |
rows = query.fetchall() | rows = query.fetchall() | |
self.assertEquals(2, len(rows)) | self.assertEquals(2, len(rows)) | |
self.assertEquals(1000, rows[0][0]) | self.assertEquals(1000, rows[0][0]) | |
self.assertEquals(1001, rows[1][0]) | self.assertEquals(1001, rows[1][0]) | |
self.assertEquals('Somebody', rows[0][1]) | self.assertEquals('Somebody', rows[0][1]) | |
self.assertEquals('Else', rows[1][1]) | self.assertEquals('Else', rows[1][1]) |
Clone # 221
Distance between two fragments = 2
Clone size = 9
Source file "./server/action_extra_data/kickstart_guest.py" The first line is 58 | Source file "./server/action_extra_data/kickstart_guest.py" The first line is 23 | |
action_status = rhnFlags.get('action_status') | action_status = rhnFlags.get('action_status') | |
if action_status == 3: ks_state = 'failed' next_action_type = None else: ks_state = 'in_progress' next_action_type = 'kickstart_guest.add_tools_channel' |
if action_status == 3: ks_state = 'failed' next_action_type = None else: ks_state = 'complete' next_action_type = None |
|
server_kickstart.update_kickstart_session(server_id, action_id, action_status, kickstart_state=ks_state, next_action_type=next_action_type) | server_kickstart.update_kickstart_session(server_id, action_id, action_status, kickstart_state=ks_state, next_action_type=next_action_type) |
Clone # 222
Distance between two fragments = 1
Clone size = 9
Source file "./server/action_extra_data/kickstart_guest.py" The first line is 41 | Source file "./server/action_extra_data/kickstart_guest.py" The first line is 23 | |
action_status = rhnFlags.get('action_status') | action_status = rhnFlags.get('action_status') | |
if action_status == 3: ks_state = 'failed' next_action_type = None else: ks_state = 'complete' next_action_type = 'kickstart_guest.schedule_virt_guest_pkg_install' |
if action_status == 3: ks_state = 'failed' next_action_type = None else: ks_state = 'complete' next_action_type = None |
|
server_kickstart.update_kickstart_session(server_id, action_id, action_status, kickstart_state=ks_state, next_action_type=next_action_type) | server_kickstart.update_kickstart_session(server_id, action_id, action_status, kickstart_state=ks_state, next_action_type=next_action_type) |
Clone # 223
Distance between two fragments = 4
Clone size = 9
Source file "./server/rhnServer/server_kickstart.py" The first line is 155 | Source file "./server/rhnServer/server_kickstart.py" The first line is 134 | |
_query_lookup_kickstart_label = rhnSQL.Statement('\n select k.label\n from rhnKickstartSession ks, rhnKSData k\n where (\n (ks.old_server_id = :server_id and ks.new_server_id is NULL) \n or ks.new_server_id = :server_id\n or ks.host_server_id = :server_id\n )\n and ks.action_id = :action_id\n and k.id = ks.kickstart_id\n') | _query_lookup_kickstart_session_id = rhnSQL.Statement('\n select ks.id\n from rhnKickstartSession ks\n where (\n (ks.old_server_id = :server_id and ks.new_server_id is NULL) \n or ks.new_server_id = :server_id\n or ks.host_server_id = :server_id\n )\n and ks.action_id = :action_id\n') | |
def get_kickstart_label(server_id, action_id): h = rhnSQL.prepare(_query_lookup_kickstart_label) h.execute(server_id=server_id, action_id=action_id) row = h.fetchone_dict() if not row: return None return row['label'] |
def get_kickstart_session_id(server_id, action_id): h = rhnSQL.prepare(_query_lookup_kickstart_session_id) h.execute(server_id=server_id, action_id=action_id) row = h.fetchone_dict() if not row: return None return row['id'] |
Clone # 224
Distance between two fragments = 0
Clone size = 9
Source file "./server/test/unit-test/test_rhnServerGroup.py" The first line is 35 | Source file "./server/test/unit-test/test_misc_functions.py" The first line is 37 | |
def tearDown(self): rhnSQL.rollback() |
def tearDown(self): rhnSQL.rollback() |
|
def test_new_org_1(self): org_id = misc_functions.create_new_org() h = rhnSQL.prepare('select id from web_customer where id = :id') h.execute(id=org_id) row = h.fetchone_dict() self.assertNotEqual(row, None) self.assertEqual(row['id'], org_id) |
def test_new_org_1(self): org_id = misc_functions.create_new_org() h = rhnSQL.prepare('select id from web_customer where id = :id') h.execute(id=org_id) row = h.fetchone_dict() self.assertNotEqual(row, None) self.assertEqual(row['id'], org_id) |
Clone # 225
Distance between two fragments = 3
Clone size = 8
Source file "./server/test/unit-test/test_server_registration.py" The first line is 192 | Source file "./server/test/unit-test/test_server_registration.py" The first line is 115 | |
params = build_new_system_params_with_token(token=token, os_release='2.1AS') | params = build_new_system_params_with_token(token=token, os_release='2.1AS') | |
system_id = register_new_system(params) | system_id = register_new_system(params) | |
rhnSQL.commit() | rhnSQL.commit() | |
s = rhnServer.get(system_id) | s = rhnServer.get(system_id) | |
self.assertNotEqual(s, None) | self.assertNotEqual(s, None) | |
server_id = s.getid() | server_id = s.getid() | |
sgs = misc_functions.fetch_server_groups(server_id) | channels = rhnChannel.channels_for_server(server_id) |
Clone # 226
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/test/testnew.py" The first line is 20 | Source file "./satellite_tools/test/test-raw-download.py" The first line is 20 | |
data = xmlrpclib.dumps((systemid), methodname='dump.channel_families') | buffer = xmlrpclib.dumps((systemid), methodname='dump.channel_families') | |
h = httplib.HTTP('roadrunner.devel.redhat.com') | h = httplib.HTTP(server) | |
h.putrequest('POST', '/SAT-DUMP') | h.putrequest('POST', '/SAT-DUMP') | |
h.putheader('Content-Type', 'text/xml') | h.putheader('X-RHN-Satellite-XML-Dump-Version', '2.0') | |
h.putheader('Content-Length', str(len(data))) | h.putheader('Content-Length', str(len(buffer))) | |
h.endheaders() | h.endheaders() | |
h.send(data) | h.send(buffer) | |
errcode, errmsg, headers = h.getreply() | errcode, errmsg, headers = h.getreply() |
Clone # 227
Distance between two fragments = 3
Clone size = 8
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 350 | Source file "./server/handlers/xmlrpc/up2date.py" The first line is 326 | |
self.set_qos = 1 | self.set_qos = 1 | |
server = self.auth_system(system_id) | server = self.auth_system(system_id) | |
log_debug(1, self.server_id, str(filename)[:100]) | log_debug(1, self.server_id, str(package)[:100]) | |
filePath = rhnPackage.get_source_package_path_by_name(self.server_id, filename) | filePath = rhnPackage.get_source_package_path_by_nvre(self.server_id, package) | |
transport = rhnFlags.get('outputTransportOptions') | transport = rhnFlags.get('outputTransportOptions') | |
transport['X-RHN-Action'] = 'source_package_by_name' | transport['X-RHN-Action'] = 'source_package' | |
return rpclib.File(open(filePath, 'r'), name=filePath) | return rpclib.File(open(filePath, 'r'), name=filePath) |
Clone # 228
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 782 | Source file "./satellite_tools/exporter/exportLib.py" The first line is 239 | |
h = rhnSQL.prepare(self._query_channel_families) | h = rhnSQL.prepare(self._query_channel_families) | |
h.execute(channel_id=channel_id) | h.execute(channel_id=channel_id) | |
arr.append(exportLib.ChannelFamiliesDumper(self._writer, data_iterator=h, ignore_subelements=1)) | arr.append(ChannelFamiliesDumper(self._writer, data_iterator=h, ignore_subelements=1)) | |
h = rhnSQL.prepare(self._query_dist_channel_map) | h = rhnSQL.prepare(self._query_dist_channel_map) | |
h.execute(channel_id=channel_id) | h.execute(channel_id=channel_id) | |
arr.append(exportLib.DistsDumper(self._writer, h)) | arr.append(DistsDumper(self._writer, h)) | |
h = self._get_cursor_source_packages() | h = self._get_cursor_source_packages() |
Clone # 229
Distance between two fragments = 2
Clone size = 8
Source file "./server/importlib/headerSource.py" The first line is 87 | Source file "./server/importlib/debPackage.py" The first line is 88 | |
vendor = self['vendor'] | vendor = self['vendor'] | |
if vendor is None: self['vendor'] = 'Red Hat, Inc.' |
if vendor is None: self['vendor'] = 'Debian' |
|
payloadFormat = self['payload_format'] | payloadFormat = self['payload_format'] | |
if payloadFormat is None: self['payload_format'] = 'cpio' |
if payloadFormat is None: self['payload_format'] = 'ar' |
|
if self['payload_size'] is None: self['payload_size'] = 0 |
if self['payload_size'] is None: self['payload_size'] = 0 |
Clone # 230
Distance between two fragments = 1
Clone size = 8
Source file "./satellite_tools/rhn_ssl_dbstore.py" The first line is 63 | Source file "./satellite_tools/rhn_satellite_activate.py" The first line is 580 | |
db_backend = CFG.DB_BACKEND | db_backend = CFG.DB_BACKEND | |
db_host = CFG.DB_HOST | db_host = CFG.DB_HOST | |
db_port = CFG.DB_PORT | db_port = CFG.DB_PORT | |
db_user = CFG.DB_user | db_user = CFG.DB_user | |
db_password = CFG.DB_PASSWORD | db_password = CFG.DB_PASSWORD | |
db_name = CFG.DB_NAME | database = CFG.DB_NAME | |
rhnSQL.initDB(backend=db_backend, host=db_host, port=db_port, username=db_user, password=db_password, database=db_name) | rhnSQL.initDB(backend=db_backend, host=db_host, port=db_port, username=db_user, password=db_password, database=database) |
Clone # 231
Distance between two fragments = 3
Clone size = 8
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 422 | Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 386 | |
writer = self._get_xml_writer() | writer = self._get_xml_writer() | |
d = dumper.SatelliteDumper(writer, dumper.ErrataDumper(writer, errata_hash.values())) | d = dumper.SatelliteDumper(writer, dump_class(writer, packages_hash.values())) | |
d.dump() | d.dump() | |
writer.flush() | writer.flush() | |
log_debug(4, 'OK') | log_debug(4, 'OK') | |
self.close() | self.close() | |
return 0 | return 0 |
Clone # 232
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1848 | Source file "./satellite_tools/satsync.py" The first line is 1676 | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) sync_handlers.import_errata(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 233
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1848 | Source file "./satellite_tools/satsync.py" The first line is 1295 | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) sync_handlers.import_errata(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 234
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1848 | Source file "./satellite_tools/satsync.py" The first line is 1119 | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) sync_handlers.import_errata(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 235
Distance between two fragments = 4
Clone size = 8
Source file "./server/action/virt.py" The first line is 262 | Source file "./server/action/virt.py" The first line is 226 | |
log_debug(3) | log_debug(3) | |
prepared_query = rhnSQL.prepare(_query_schedulePoller) | prepared_query = rhnSQL.prepare(_query_setMemory) | |
prepared_query.execute(action_id=action_id) | prepared_query.execute(action_id=action_id) | |
row = prepared_query.fetchone_dict() | row = prepared_query.fetchone_dict() | |
if not row: raise InvalidAction('No schedulePoller actions found.') |
if not row: raise InvalidAction('No setMemory actions found.') |
|
if not row.has_key('minute'): raise InvalidAction(('schedulePoller action %s has no minute associated with it.') % (str(action_id))) |
if not row.has_key('uuid'): raise InvalidAction(('Set Memory action %s has no uuid.') % (str(action_id))) |
Clone # 236
Distance between two fragments = 3
Clone size = 9
Source file "./server/rhnDependency.py" The first line is 587 | Source file "./server/rhnDependency.py" The first line is 427 | |
nvre = ['name', 'version', 'release', 'epoch', 'arch'] | nvre = ['name', 'version', 'release', 'epoch', 'arch'] | |
deplist = [] | deplist = [] | |
for dep in deps: if dep not in deplist: deplist.append(dep) |
for dep in deps: if dep not in deplist: deplist.append(dep) |
|
statement = ('%s UNION ALL %s UNION ALL %s') % ((__packages_sql, __provides_sql, __files_sql)) | statement = ('%s UNION ALL %s UNION ALL %s') % ((__packages_all_sql, __provides_all_sql, __files_all_sql)) | |
h = rhnSQL.prepare(statement) | h = rhnSQL.prepare(statement) | |
packages = {} | packages = {} |
Clone # 237
Distance between two fragments = 2
Clone size = 8
Source file "./server/rhnRepository.py" The first line is 136 | Source file "./server/rhnRepository.py" The first line is 81 | |
def listAllPackages(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_all_packages(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
def listPackages(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_packages(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
Clone # 238
Distance between two fragments = 3
Clone size = 8
Source file "./server/rhnRepository.py" The first line is 155 | Source file "./server/rhnRepository.py" The first line is 101 | |
def listAllPackagesComplete(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_all_packages_complete(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
def getObsoletes(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) obsoletes = rhnChannel.list_obsoletes(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return obsoletes |
Clone # 239
Distance between two fragments = 2
Clone size = 8
Source file "./server/rhnRepository.py" The first line is 155 | Source file "./server/rhnRepository.py" The first line is 136 | |
def listAllPackagesComplete(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_all_packages_complete(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
def listAllPackages(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_all_packages(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
Clone # 240
Distance between two fragments = 2
Clone size = 8
Source file "./server/rhnRepository.py" The first line is 155 | Source file "./server/rhnRepository.py" The first line is 81 | |
def listAllPackagesComplete(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_all_packages_complete(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
def listPackages(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_packages(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
Clone # 241
Distance between two fragments = 3
Clone size = 8
Source file "./server/rhnRepository.py" The first line is 101 | Source file "./server/rhnRepository.py" The first line is 136 | |
def getObsoletes(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) obsoletes = rhnChannel.list_obsoletes(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return obsoletes |
def listAllPackages(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_all_packages(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
Clone # 242
Distance between two fragments = 3
Clone size = 8
Source file "./server/rhnRepository.py" The first line is 101 | Source file "./server/rhnRepository.py" The first line is 81 | |
def getObsoletes(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) obsoletes = rhnChannel.list_obsoletes(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return obsoletes |
def listPackages(self, version): log_debug(3, self.channelName, version) self.__check_channel(version) packages = rhnChannel.list_packages(self.channelName) transportOptions = rhnFlags.get('outputTransportOptions') transportOptions['Last-Modified'] = rfc822time(timestamp(version)) rhnFlags.set('compress_response', 1) return packages |
Clone # 243
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 80 | Source file "./test/johntest.py" The first line is 71 | |
def package(self, package): if package is None: return None if self._package is None: s = self._connect() sysid = self._get_sysid() self._package = s.up2date.package(sysid, package) return self._package |
def header(self, pkglist): if pkglist is None: return None if self._header_data is None: s = self._connect() sysid = self._get_sysid() self._package_data = s.up2date.header(sysid, pkglist) return self._header_data |
Clone # 244
Distance between two fragments = 0
Clone size = 8
Source file "./spacewalk/common/rhn_mpm.py" The first line is 156 | Source file "./server/handlers/app/rhn_mpm.py" The first line is 132 | |
self.__init__() | self.__init__() | |
arr = self._read_lead(input_stream) | arr = self._read_lead(input_stream) | |
magic = arr[0] | magic = arr[0] | |
if magic != self._magic: raise InvalidPackageError() |
if magic != self._magic: raise InvalidPackageError() |
|
header_len, payload_len = (int(arr[5]), int(arr[6])) | header_len, payload_len = (int(arr[5]), int(arr[6])) | |
header_flags, payload_flags = (arr[3], arr[4]) | header_flags, payload_flags = (arr[3], arr[4]) | |
file_size = ((128) + (header_len)) + (payload_len) | file_size = ((128) + (header_len)) + (payload_len) |
Clone # 245
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 247 | Source file "./test/johntest.py" The first line is 242 | |
def get_signature(self): if self.login_dict.has_key(self._sig_key): return self.login_dict[self._sig_key] return None |
def get_user_id(self): if self.login_dict.has_key(self._user_key): return self.login_dict[self._user_key] return None |
|
def get_server_time(self): if self.login_dict.has_key(self._time_key): return self.login_dict[self._time_key] return None |
def get_signature(self): if self.login_dict.has_key(self._sig_key): return self.login_dict[self._sig_key] return None |
Clone # 246
Distance between two fragments = 4
Clone size = 8
Source file "./server/action/utils.py" The first line is 204 | Source file "./server/action/utils.py" The first line is 196 | |
def get_evr_id(self): if not self.evr_id: self._get_package_field_ids() return self.evr_id |
def get_name_id(self): if not self.name_id: self._get_package_field_ids() return self.name_id |
|
def get_arch_id(self): if not self.arch_id: self._get_package_field_ids() return self.arch_id |
def get_evr_id(self): if not self.evr_id: self._get_package_field_ids() return self.evr_id |
Clone # 247
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 252 | Source file "./test/johntest.py" The first line is 242 | |
def get_server_time(self): if self.login_dict.has_key(self._time_key): return self.login_dict[self._time_key] return None |
def get_user_id(self): if self.login_dict.has_key(self._user_key): return self.login_dict[self._user_key] return None |
|
def get_expire_offset(self): if self.login_dict.has_key(self._expire_key): return self.login_dict[self._expire_key] return None |
def get_signature(self): if self.login_dict.has_key(self._sig_key): return self.login_dict[self._sig_key] return None |
Clone # 248
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 112 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 97 | |
def get_packages_statement(self): query = ("\n select p.id package_id, \n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannelPackage cp, rhnPackage p, \n rhnChannelFamilyMembers cfm,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = cp.channel_id\n and cp.package_id = :package_id\n and p.id = :package_id\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
def get_channels_statement(self): query = ("\n select c.id channel_id, c.label,\n\t ct.label as checksum_type,\n TO_CHAR(c.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannel c, rhnChannelFamilyMembers cfm,\n\t rhnChecksumType ct,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = c.id\n\t and c.checksum_type_id = ct.id(+)\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
|
def get_source_packages_statement(self): query = ("\n select ps.id package_id,\n TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannelPackage cp, rhnPackage p, rhnPackageSource ps,\n rhnChannelFamilyMembers cfm,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = cp.channel_id\n and cp.package_id = p.id\n and p.source_rpm_id = ps.source_rpm_id\n and ((p.org_id is null and ps.org_id is null) or\n p.org_id = ps.org_id)\n and ps.id = :package_id\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
def get_packages_statement(self): query = ("\n select p.id package_id, \n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannelPackage cp, rhnPackage p, \n rhnChannelFamilyMembers cfm,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = cp.channel_id\n and cp.package_id = :package_id\n and p.id = :package_id\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
Clone # 249
Distance between two fragments = 4
Clone size = 8
Source file "./server/action/utils.py" The first line is 212 | Source file "./server/action/utils.py" The first line is 196 | |
def get_arch_id(self): if not self.arch_id: self._get_package_field_ids() return self.arch_id |
def get_name_id(self): if not self.name_id: self._get_package_field_ids() return self.name_id |
|
def get_id(self): if not self.id: self._get_package_field_ids() return self.id |
def get_evr_id(self): if not self.evr_id: self._get_package_field_ids() return self.evr_id |
Clone # 250
Distance between two fragments = 4
Clone size = 8
Source file "./server/action/utils.py" The first line is 242 | Source file "./server/action/utils.py" The first line is 234 | |
def get_release(self): if not self.release: self._get_package_info() return self.release |
def get_version(self): if not self.version: self._get_package_info() return self.version |
|
def get_epoch(self): if not self.epoch: self._get_package_info() return self.epoch |
def get_release(self): if not self.release: self._get_package_info() return self.release |
Clone # 251
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 97 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 127 | |
def get_channels_statement(self): query = ("\n select c.id channel_id, c.label,\n\t ct.label as checksum_type,\n TO_CHAR(c.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannel c, rhnChannelFamilyMembers cfm,\n\t rhnChecksumType ct,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = c.id\n\t and c.checksum_type_id = ct.id(+)\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
def get_source_packages_statement(self): query = ("\n select ps.id package_id,\n TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannelPackage cp, rhnPackage p, rhnPackageSource ps,\n rhnChannelFamilyMembers cfm,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = cp.channel_id\n and cp.package_id = p.id\n and p.source_rpm_id = ps.source_rpm_id\n and ((p.org_id is null and ps.org_id is null) or\n p.org_id = ps.org_id)\n and ps.id = :package_id\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
|
def get_packages_statement(self): query = ("\n select p.id package_id, \n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannelPackage cp, rhnPackage p, \n rhnChannelFamilyMembers cfm,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = cp.channel_id\n and cp.package_id = :package_id\n and p.id = :package_id\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
def get_errata_statement(self): query = ("\n select e.id errata_id, \n TO_CHAR(e.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnChannelErrata ce, rhnErrata e,\n rhnChannelFamilyMembers cfm,\n (%s\n ) scf\n where scf.channel_family_id = cfm.channel_family_id\n and cfm.channel_id = ce.channel_id\n and ce.errata_id = :errata_id\n and e.id = :errata_id\n ") % (self._channel_family_query) return DatabaseStatement().set_statement(rhnSQL.prepare(query)) |
Clone # 252
Distance between two fragments = 4
Clone size = 8
Source file "./server/action/utils.py" The first line is 250 | Source file "./server/action/utils.py" The first line is 234 | |
def get_epoch(self): if not self.epoch: self._get_package_info() return self.epoch |
def get_version(self): if not self.version: self._get_package_info() return self.version |
|
def get_arch(self): if not self.arch: self._get_package_info() return self.arch |
def get_release(self): if not self.release: self._get_package_info() return self.release |
Clone # 253
Distance between two fragments = 4
Clone size = 8
Source file "./server/action/utils.py" The first line is 78 | Source file "./server/action/utils.py" The first line is 69 | |
def get_channel_id(self): if not self.channel_id: self._get_channel_info() return self.channel_id |
def is_subscribed_to_channel(self): if not self.found_channel: self._get_channel_info() return self.found_channel |
|
def get_channel_label(self): if not self.channel_label: self._get_channel_info() return self.channel_label |
def get_channel_id(self): if not self.channel_id: self._get_channel_info() return self.channel_id |
Clone # 254
Distance between two fragments = 3
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1968 | Source file "./satellite_tools/satsync.py" The first line is 1446 | |
try: rpmManip.write_file(stream) break except FileCreationError, e: msg = e[0] log2disk(-1, ('Unable to save file %s: %s') % ((rpmManip.full_path, msg))) continue |
try: f.write_file(stream) break except FileCreationError, e: msg = e[0] log2disk(-1, ('Unable to save file %s: %s') % ((path, msg))) continue |
Clone # 255
Distance between two fragments = 0
Clone size = 8
Source file "./spacewalk/common/rhn_deb.py" The first line is 42 | Source file "./spacewalk/common/rhn_mpm.py" The first line is 41 | |
if (filename is None) and (file is None) and (fd is None): raise ValueError, 'No parameters passed' |
if (filename is None) and (file is None) and (fd is None): raise ValueError, 'No parameters passed' |
|
if filename is not None: f = open(filename) elif file is not None: f = file else: f = os.fdopen(os.dup(fd), 'r') |
if filename is not None: f = open(filename) elif file is not None: f = file else: f = os.fdopen(os.dup(fd), 'r') |
|
f.seek(0, 0) | f.seek(0, 0) |
Clone # 256
Distance between two fragments = 0
Clone size = 8
Source file "./spacewalk/common/rhn_deb.py" The first line is 42 | Source file "./server/handlers/app/rhn_mpm.py" The first line is 38 | |
if (filename is None) and (file is None) and (fd is None): raise ValueError, 'No parameters passed' |
if (filename is None) and (file is None) and (fd is None): raise ValueError, 'No parameters passed' |
|
if filename is not None: f = open(filename) elif file is not None: f = file else: f = os.fdopen(os.dup(fd), 'r') |
if filename is not None: f = open(filename) elif file is not None: f = file else: f = os.fdopen(os.dup(fd), 'r') |
|
f.seek(0, 0) | f.seek(0, 0) |
Clone # 257
Distance between two fragments = 4
Clone size = 8
Source file "./server/configFilesHandler.py" The first line is 46 | Source file "./server/configFilesHandler.py" The first line is 43 | |
class ConfigFileVersionMismatchError(ConfigFileError): pass |
class ConfigFileExistsError(ConfigFileError): pass |
|
class ConfigFileMissingDelimError(ConfigFileError): pass |
class ConfigFileVersionMismatchError(ConfigFileError): pass |
|
class ConfigFileMissingInfoError(ConfigFileError): pass |
class ConfigFileMissingDelimError(ConfigFileError): pass |
|
class ConfigFileMissingContentError(ConfigFileError): pass |
class ConfigFileMissingInfoError(ConfigFileError): pass |
Clone # 258
Distance between two fragments = 4
Clone size = 8
Source file "./server/configFilesHandler.py" The first line is 58 | Source file "./server/configFilesHandler.py" The first line is 55 | |
class ConfigFileMissingStatInfo(ConfigFileError): pass |
class ConfigFileMissingContentError(ConfigFileError): pass |
|
class ConfigFileTooLargeError(ConfigFileError): pass |
class ConfigFileMissingStatInfo(ConfigFileError): pass |
|
class ConfigFileExceedsQuota(ConfigFileError): pass |
class ConfigFileTooLargeError(ConfigFileError): pass |
|
class ConfigFilePathIncomplete(ConfigFileError): pass |
class ConfigFileExceedsQuota(ConfigFileError): pass |
Clone # 259
Distance between two fragments = 4
Clone size = 8
Source file "./server/importlib/importLib.py" The first line is 744 | Source file "./server/importlib/importLib.py" The first line is 738 | |
class InvalidArchError(ImportException): def __init__(self, arch, *rest): ImportException.__init__(self, rest) self.arch = arch |
class InvalidPackageError(ImportException): def __init__(self, package, *rest): ImportException.__init__(self, rest) self.package = package |
|
class InvalidChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
class InvalidArchError(ImportException): def __init__(self, arch, *rest): ImportException.__init__(self, rest) self.arch = arch |
Clone # 260
Distance between two fragments = 3
Clone size = 8
Source file "./server/importlib/importLib.py" The first line is 756 | Source file "./server/importlib/importLib.py" The first line is 750 | |
class MissingParentChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
class InvalidChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
|
class InvalidChannelFamilyError(ImportException): def __init__(self, channel_family, *rest): ImportException.__init__(self, rest) self.channel_family = channel_family |
class MissingParentChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
Clone # 261
Distance between two fragments = 4
Clone size = 8
Source file "./server/configFilesHandler.py" The first line is 49 | Source file "./server/configFilesHandler.py" The first line is 43 | |
class ConfigFileMissingDelimError(ConfigFileError): pass |
class ConfigFileExistsError(ConfigFileError): pass |
|
class ConfigFileMissingInfoError(ConfigFileError): pass |
class ConfigFileVersionMismatchError(ConfigFileError): pass |
|
class ConfigFileMissingContentError(ConfigFileError): pass |
class ConfigFileMissingDelimError(ConfigFileError): pass |
|
class ConfigFileMissingStatInfo(ConfigFileError): pass |
class ConfigFileMissingInfoError(ConfigFileError): pass |
Clone # 262
Distance between two fragments = 4
Clone size = 8
Source file "./server/importlib/importLib.py" The first line is 750 | Source file "./server/importlib/importLib.py" The first line is 738 | |
class InvalidChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
class InvalidPackageError(ImportException): def __init__(self, package, *rest): ImportException.__init__(self, rest) self.package = package |
|
class MissingParentChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
class InvalidArchError(ImportException): def __init__(self, arch, *rest): ImportException.__init__(self, rest) self.arch = arch |
Clone # 263
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnChannel.py" The first line is 58 | Source file "./server/rhnChannel.py" The first line is 55 | |
class InvalidEntryError(Exception): pass |
class IncompatibilityError(Exception): pass |
|
class InvalidDataError(Exception): pass |
class InvalidEntryError(Exception): pass |
|
class ForceNotSpecified(Exception): pass |
class InvalidDataError(Exception): pass |
|
class ChannelNotFoundError(Exception): pass |
class ForceNotSpecified(Exception): pass |
Clone # 264
Distance between two fragments = 4
Clone size = 8
Source file "./server/configFilesHandler.py" The first line is 43 | Source file "./server/configFilesHandler.py" The first line is 52 | |
class ConfigFileExistsError(ConfigFileError): pass |
class ConfigFileMissingInfoError(ConfigFileError): pass |
|
class ConfigFileVersionMismatchError(ConfigFileError): pass |
class ConfigFileMissingContentError(ConfigFileError): pass |
|
class ConfigFileMissingDelimError(ConfigFileError): pass |
class ConfigFileMissingStatInfo(ConfigFileError): pass |
|
class ConfigFileMissingInfoError(ConfigFileError): pass |
class ConfigFileTooLargeError(ConfigFileError): pass |
Clone # 265
Distance between two fragments = 4
Clone size = 8
Source file "./server/importlib/importLib.py" The first line is 738 | Source file "./server/importlib/importLib.py" The first line is 756 | |
class InvalidPackageError(ImportException): def __init__(self, package, *rest): ImportException.__init__(self, rest) self.package = package |
class MissingParentChannelError(ImportException): def __init__(self, channel, *rest): ImportException.__init__(self, rest) self.channel = channel |
|
class InvalidArchError(ImportException): def __init__(self, arch, *rest): ImportException.__init__(self, rest) self.arch = arch |
class InvalidChannelFamilyError(ImportException): def __init__(self, channel_family, *rest): ImportException.__init__(self, rest) self.channel_family = channel_family |
Clone # 266
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnChannel.py" The first line is 55 | Source file "./server/rhnChannel.py" The first line is 61 | |
class IncompatibilityError(Exception): pass |
class InvalidDataError(Exception): pass |
|
class InvalidEntryError(Exception): pass |
class ForceNotSpecified(Exception): pass |
|
class InvalidDataError(Exception): pass |
class ChannelNotFoundError(Exception): pass |
|
class ForceNotSpecified(Exception): pass |
class NoToolsChannel(Exception): pass |
Clone # 267
Distance between two fragments = 4
Clone size = 8
Source file "./server/configFilesHandler.py" The first line is 43 | Source file "./server/configFilesHandler.py" The first line is 55 | |
class ConfigFileExistsError(ConfigFileError): pass |
class ConfigFileMissingContentError(ConfigFileError): pass |
|
class ConfigFileVersionMismatchError(ConfigFileError): pass |
class ConfigFileMissingStatInfo(ConfigFileError): pass |
|
class ConfigFileMissingDelimError(ConfigFileError): pass |
class ConfigFileTooLargeError(ConfigFileError): pass |
|
class ConfigFileMissingInfoError(ConfigFileError): pass |
class ConfigFileExceedsQuota(ConfigFileError): pass |
Clone # 268
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnChannel.py" The first line is 55 | Source file "./server/rhnChannel.py" The first line is 64 | |
class IncompatibilityError(Exception): pass |
class ForceNotSpecified(Exception): pass |
|
class InvalidEntryError(Exception): pass |
class ChannelNotFoundError(Exception): pass |
|
class InvalidDataError(Exception): pass |
class NoToolsChannel(Exception): pass |
|
class ForceNotSpecified(Exception): pass |
class NoChildChannels(Exception): pass |
Clone # 269
Distance between two fragments = 4
Clone size = 8
Source file "./server/configFilesHandler.py" The first line is 43 | Source file "./server/configFilesHandler.py" The first line is 58 | |
class ConfigFileExistsError(ConfigFileError): pass |
class ConfigFileMissingStatInfo(ConfigFileError): pass |
|
class ConfigFileVersionMismatchError(ConfigFileError): pass |
class ConfigFileTooLargeError(ConfigFileError): pass |
|
class ConfigFileMissingDelimError(ConfigFileError): pass |
class ConfigFileExceedsQuota(ConfigFileError): pass |
|
class ConfigFileMissingInfoError(ConfigFileError): pass |
class ConfigFilePathIncomplete(ConfigFileError): pass |
Clone # 270
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnChannel.py" The first line is 55 | Source file "./server/rhnChannel.py" The first line is 67 | |
class IncompatibilityError(Exception): pass |
class ChannelNotFoundError(Exception): pass |
|
class InvalidEntryError(Exception): pass |
class NoToolsChannel(Exception): pass |
|
class InvalidDataError(Exception): pass |
class NoChildChannels(Exception): pass |
|
class ForceNotSpecified(Exception): pass |
class InvalidChannel(Exception): pass |
Clone # 271
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnDependency.py" The first line is 287 | Source file "./server/rhnDependency.py" The first line is 290 | |
class InvalidLimitField(SolveDependenciesError): pass |
class InvalidLimitOperator(SolveDependenciesError): pass |
|
class InvalidLimitOperator(SolveDependenciesError): pass |
class InvalidLimit(SolveDependenciesError): pass |
|
class InvalidLimit(SolveDependenciesError): pass |
class IncompleteLimitInfo(SolveDependenciesError): pass |
|
class IncompleteLimitInfo(SolveDependenciesError): pass |
class MakeEvrError(SolveDependenciesError): pass |
Clone # 272
Distance between two fragments = 0
Clone size = 8
Source file "./server/rhnDependency.py" The first line is 682 | Source file "./server/rhnDependency.py" The first line is 590 | |
deplist = [] | deplist = [] | |
for dep in deps: if dep not in deplist: deplist.append(dep) |
for dep in deps: if dep not in deplist: deplist.append(dep) |
|
statement = ('%s UNION ALL %s UNION ALL %s') % ((__packages_sql, __provides_sql, __files_sql)) | statement = ('%s UNION ALL %s UNION ALL %s') % ((__packages_sql, __provides_sql, __files_sql)) | |
h = rhnSQL.prepare(statement) | h = rhnSQL.prepare(statement) | |
packages = {} | packages = {} |
Clone # 273
Distance between two fragments = 0
Clone size = 8
Source file "./server/importlib/packageUpload.py" The first line is 188 | Source file "./server/importlib/packageUpload.py" The first line is 160 | |
channelHash = {} | channelHash = {} | |
channels = [] | channels = [] | |
for channel in channelList: if channelHash.has_key(channel): continue channels.append(channel) channelHash[channel] = None |
for channel in channelList: if channelHash.has_key(channel): continue channels.append(channel) channelHash[channel] = None |
|
rez = [] | rez = [] |
Clone # 274
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnCapability.py" The first line is 142 | Source file "./server/rhnCapability.py" The first line is 134 | |
if updates['server_id']: h = rhnSQL.prepare('\n update rhnClientCapability\n set version = :version\n where server_id = :server_id\n and capability_name_id = :capability_name_id\n ') apply(h.executemany, (), updates) |
if deletes['server_id']: h = rhnSQL.prepare('\n delete from rhnClientCapability\n where server_id = :server_id\n and capability_name_id = :capability_name_id\n ') apply(h.executemany, (), deletes) |
|
if inserts['server_id']: h = rhnSQL.prepare('\n insert into rhnClientCapability \n (server_id, capability_name_id, version) \n values (:server_id, LOOKUP_CLIENT_CAPABILITY(:capability), :version)\n ') apply(h.executemany, (), inserts) |
if updates['server_id']: h = rhnSQL.prepare('\n update rhnClientCapability\n set version = :version\n where server_id = :server_id\n and capability_name_id = :capability_name_id\n ') apply(h.executemany, (), updates) |
Clone # 275
Distance between two fragments = 1
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 656 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 627 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting short packages...') | log2stdout(1, 'Exporting packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 276
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 723 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 749 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart data...') | log2stdout(1, 'Exporting kickstart files...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_trees), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_files), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 277
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 723 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 809 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart data...') | log2stdout(1, 'Exporting binary RPMs...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_trees), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.brpms), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 278
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 723 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 695 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart data...') | log2stdout(1, 'Exporting errata...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_trees), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.errata_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 279
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 723 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 656 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart data...') | log2stdout(1, 'Exporting short packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_trees), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 280
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 723 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 627 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart data...') | log2stdout(1, 'Exporting packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_trees), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 281
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 723 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 573 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart data...') | log2stdout(1, 'Exporting channel info...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_trees), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.channel_ids), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 282
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 749 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 809 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart files...') | log2stdout(1, 'Exporting binary RPMs...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_files), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.brpms), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 283
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 749 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 695 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart files...') | log2stdout(1, 'Exporting errata...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_files), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.errata_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 284
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 749 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 656 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart files...') | log2stdout(1, 'Exporting short packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_files), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 285
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 749 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 627 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart files...') | log2stdout(1, 'Exporting packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_files), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 286
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 749 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 573 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting kickstart files...') | log2stdout(1, 'Exporting channel info...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.kickstart_files), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.channel_ids), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 287
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 809 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 695 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting binary RPMs...') | log2stdout(1, 'Exporting errata...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.brpms), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.errata_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 288
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 809 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 656 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting binary RPMs...') | log2stdout(1, 'Exporting short packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.brpms), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 289
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 809 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 627 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting binary RPMs...') | log2stdout(1, 'Exporting packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.brpms), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 290
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 809 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 573 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting binary RPMs...') | log2stdout(1, 'Exporting channel info...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.brpms), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.channel_ids), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 291
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 695 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 656 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting errata...') | log2stdout(1, 'Exporting short packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.errata_info), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 292
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 695 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 627 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting errata...') | log2stdout(1, 'Exporting packages...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.errata_info), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 293
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 695 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 573 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting errata...') | log2stdout(1, 'Exporting channel info...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.errata_info), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.channel_ids), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 294
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 656 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 573 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting short packages...') | log2stdout(1, 'Exporting channel info...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.channel_ids), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 295
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 627 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 573 | |
print '\n' | print '\n' | |
log2stdout(1, 'Exporting packages...') | log2stdout(1, 'Exporting channel info...') | |
pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.pkg_info), self.pb_length, self.pb_char) | pb = progress_bar.ProgressBar(self.pb_label, self.pb_complete, len(self.channel_ids), self.pb_length, self.pb_char) | |
pb.printAll(1) | pb.printAll(1) |
Clone # 296
Distance between two fragments = 2
Clone size = 8
Source file "./server/rhnDependency.py" The first line is 313 | Source file "./server/rhnDependency.py" The first line is 302 | |
def __single_query_with_arch_and_id(server_id, deps, query): ret = {} h = rhnSQL.prepare(query) for dep in deps: h.execute(server_id=server_id, dep=dep) data = (h.fetchall()) or ([]) ret[dep] = map(lambda a: a[:6], data) return ret |
def __single_query(server_id, deps, query): ret = {} h = rhnSQL.prepare(query) for dep in deps: h.execute(server_id=server_id, dep=dep) data = (h.fetchall()) or ([]) ret[dep] = map(lambda a: a[:4], data) return ret |
Clone # 297
Distance between two fragments = 0
Clone size = 8
Source file "./server/importlib/debPackage.py" The first line is 156 | Source file "./server/importlib/headerSource.py" The first line is 183 | |
def _populateChannels(self, channels): l = [] for channel in channels: dict = {'label': channel} obj = Channel() obj.populate(dict) l.append(obj) self['channels'] = l |
def _populateChannels(self, channels): l = [] for channel in channels: dict = {'label': channel} obj = Channel() obj.populate(dict) l.append(obj) self['channels'] = l |
Clone # 298
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/test/test-download.py" The first line is 50 | Source file "./satellite_tools/test/test-download.py" The first line is 45 | |
if 0: f = s.dump.arches_extra(systemid) print f.read() sys.exit(0) |
if 0: f = s.dump.channel_families(systemid) print f.read() sys.exit(0) |
|
if 0: f = s.dump.arches(systemid) print f.read() sys.exit(0) |
if 0: f = s.dump.arches_extra(systemid) print f.read() sys.exit(0) |
Clone # 299
Distance between two fragments = 4
Clone size = 8
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 377 | Source file "./server/handlers/xmlrpc/up2date.py" The first line is 365 | |
def solveDependencies(self, system_id, deps): log_debug(4, system_id) return self.__solveDep(system_id, deps, action='solvedep', clientVersion=2) |
def solvedep(self, system_id, deps): log_debug(4, system_id) return self.__solveDep(system_id, deps, action='solvedep', clientVersion=1) |
|
def solveDependencies_arch(self, system_id, deps): log_debug(4, system_id) return self.__solveDep_arch(system_id, deps, action='solvedep', clientVersion=2) |
def solveDependencies(self, system_id, deps): log_debug(4, system_id) return self.__solveDep(system_id, deps, action='solvedep', clientVersion=2) |
Clone # 300
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1268 | Source file "./satellite_tools/satsync.py" The first line is 1092 | |
missing_packages = self._compute_not_cached_source_packages() | missing_packages = self._missing_not_cached_packages() | |
h = sync_handlers.get_source_package_handler() | h = sync_handlers.get_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.SourcePackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getSourcePackageXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.PackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getPackageXmlStream stream_loader.set_wire_loader(s) |
Clone # 301
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1379 | Source file "./satellite_tools/satsync.py" The first line is 859 | |
self._compute_unique_kickstarts() | self._compute_unique_packages() | |
h = sync_handlers.get_kickstarts_handler() | h = sync_handlers.get_short_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.KickstartDataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getKickstartsXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.ShortPackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getChannelShortPackagesXmlStream stream_loader.set_wire_loader(s) |
Clone # 302
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnVirtualization.py" The first line is 964 | Source file "./server/rhnVirtualization.py" The first line is 953 | |
handler.handle(host_sysid, crawl_began) | handler.handle(guest_sysid, guest_exists) | |
handler.handle(host_sysid, crawl_ended) | handler.handle(guest_sysid, crawl_began) | |
handler.handle(host_sysid, host_exists) | handler.handle(guest_sysid, crawl_ended) | |
handler.handle(host_sysid, crawl_began) | handler.handle(host_sysid, crawl_began) | |
handler.handle(host_sysid, dom0_exists) | handler.handle(host_sysid, dom0_exists) | |
handler.handle(host_sysid, domU1_exists) | handler.handle(host_sysid, domU1_exists) | |
handler.handle(host_sysid, domU2_exists) | handler.handle(host_sysid, domU2_exists) | |
handler.handle(host_sysid, crawl_ended) | handler.handle(host_sysid, crawl_ended) |
Clone # 303
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnServer/server_token.py" The first line is 1092 | Source file "./server/rhnServer/server_token.py" The first line is 1081 | |
if history.has_key('packages'): report.write('Packages Scheduled for Installation:\n') report.write('
for p in history['packages']: report.write((' if len(history['packages']) == 0: report.write(' report.write(' |
if history.has_key('groups'): report.write('System Group Membership Information:\n') report.write('
for g in history['groups']: report.write((' if len(history['groups']) == 0: report.write(' report.write(' |
Clone # 304
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnServer/server_token.py" The first line is 1105 | Source file "./server/rhnServer/server_token.py" The first line is 1092 | |
if history.has_key('config_channels'): report.write('Config Channel Subscription Information:\n') report.write('
for c in history['config_channels']: report.write((' if len(history['config_channels']) == 0: report.write(' report.write(' |
if history.has_key('packages'): report.write('Packages Scheduled for Installation:\n') report.write('
for p in history['packages']: report.write((' if len(history['packages']) == 0: report.write(' report.write(' |
Clone # 305
Distance between two fragments = 4
Clone size = 8
Source file "./server/rhnServer/server_token.py" The first line is 1105 | Source file "./server/rhnServer/server_token.py" The first line is 1081 | |
if history.has_key('config_channels'): report.write('Config Channel Subscription Information:\n') report.write('
for c in history['config_channels']: report.write((' if len(history['config_channels']) == 0: report.write(' report.write(' |
if history.has_key('groups'): report.write('System Group Membership Information:\n') report.write('
for g in history['groups']: report.write((' if len(history['groups']) == 0: report.write(' report.write(' |
Clone # 306
Distance between two fragments = 4
Clone size = 8
Source file "./server/action_extra_data/virt.py" The first line is 37 | Source file "./server/action_extra_data/virt.py" The first line is 34 | |
def reboot(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def schedulePoller(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def reboot(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def suspend(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
Clone # 307
Distance between two fragments = 4
Clone size = 8
Source file "./server/action_extra_data/virt.py" The first line is 49 | Source file "./server/action_extra_data/virt.py" The first line is 46 | |
def shutdown(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def suspend(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def destroy(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def shutdown(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def setMemory(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def destroy(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def setVCPUs(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def setMemory(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
Clone # 308
Distance between two fragments = 4
Clone size = 8
Source file "./server/action_extra_data/virt.py" The first line is 40 | Source file "./server/action_extra_data/virt.py" The first line is 34 | |
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def schedulePoller(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def reboot(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def suspend(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def shutdown(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
Clone # 309
Distance between two fragments = 4
Clone size = 8
Source file "./server/action_extra_data/virt.py" The first line is 43 | Source file "./server/action_extra_data/virt.py" The first line is 34 | |
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def schedulePoller(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def suspend(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def reboot(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def shutdown(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def destroy(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
Clone # 310
Distance between two fragments = 4
Clone size = 8
Source file "./server/action_extra_data/virt.py" The first line is 46 | Source file "./server/action_extra_data/virt.py" The first line is 34 | |
def suspend(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def schedulePoller(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def shutdown(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def reboot(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def destroy(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def setMemory(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
Clone # 311
Distance between two fragments = 4
Clone size = 8
Source file "./server/action_extra_data/virt.py" The first line is 49 | Source file "./server/action_extra_data/virt.py" The first line is 34 | |
def shutdown(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def schedulePoller(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def destroy(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def reboot(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def setMemory(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def resume(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
|
def setVCPUs(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
def start(server_id, action_id, data={}): _do_nothing(server_id, action_id) |
Clone # 312
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 436 | Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 422 | |
writer = self._get_xml_writer() | writer = self._get_xml_writer() | |
d = dumper.SatelliteDumper(writer, dumper.KickstartableTreesDumper(writer, kickstarts=kickstarts)) | d = dumper.SatelliteDumper(writer, dumper.ErrataDumper(writer, errata_hash.values())) | |
d.dump() | d.dump() | |
writer.flush() | writer.flush() | |
log_debug(4, 'OK') | log_debug(4, 'OK') | |
self.close() | self.close() | |
return 0 | return 0 |
Clone # 313
Distance between two fragments = 3
Clone size = 8
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 386 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 391 | |
writer = self._get_xml_writer() | writer = self._get_xml_writer() | |
d = dumper.SatelliteDumper(writer, dump_class(writer, packages_hash.values())) | dumper = SatelliteDumper(writer, dump_class(writer, packages_hash.values())) | |
d.dump() | dumper.dump() | |
writer.flush() | writer.flush() | |
log_debug(4, 'OK') | log_debug(4, 'OK') | |
self.close() | self.close() | |
return 0 | return 0 |
Clone # 314
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 430 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 391 | |
writer = self._get_xml_writer() | writer = self._get_xml_writer() | |
dumper = SatelliteDumper(writer, ErrataDumper(writer, errata_hash.values())) | dumper = SatelliteDumper(writer, dump_class(writer, packages_hash.values())) | |
dumper.dump() | dumper.dump() | |
writer.flush() | writer.flush() | |
log_debug(4, 'OK') | log_debug(4, 'OK') | |
self.close() | self.close() | |
return 0 | return 0 |
Clone # 315
Distance between two fragments = 1
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 880 | Source file "./satellite_tools/satsync.py" The first line is 350 | |
body = dumpEMAIL_LOG() | body = dumpEMAIL_LOG() | |
if body: print '+++ sending log as an email +++' headers = {'Subject': ('Spacewalk Management Satellite Export report from %s') % (os.uname()[1])} sndr = 'rhn-satellite' rhnMail.send(headers, body, sender=sndr) else: print '+++ email requested, but there is nothing to send +++' |
if body: print '+++ sending log as an email +++' headers = {'Subject': ('RHN Management Satellite sync. report from %s') % (os.uname()[1])} sndr = 'rhn-satellite' rhnMail.send(headers, body, sender=sndr) else: print '+++ email requested, but there is nothing to send +++' |
Clone # 316
Distance between two fragments = 3
Clone size = 8
Source file "./server/importlib/backend.py" The first line is 1116 | Source file "./server/importlib/backend.py" The first line is 880 | |
if dcm.ignored: continue |
if relcms.ignored: pass |
|
h = lookup.query(dcm) | h = lookup.query(relcms) | |
row = h.fetchone_dict() | row = h.fetchone_dict() | |
if not row: extObject = {} _buildExternalValue(extObject, dcm, dcmTable) addHash(dmlobj.insert[dcmTable.name], extObject) |
if not row: extObject = {} _buildExternalValue(extObject, relcms, rcmTable) addHash(dmlobj.insert[rcmTable.name], extObject) |
Clone # 317
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 175 | Source file "./test/johntest.py" The first line is 170 | |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 318
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 185 | Source file "./test/johntest.py" The first line is 180 | |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
|
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
Clone # 319
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 195 | Source file "./test/johntest.py" The first line is 190 | |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
|
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
Clone # 320
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 205 | Source file "./test/johntest.py" The first line is 200 | |
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
|
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
Clone # 321
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 180 | Source file "./test/johntest.py" The first line is 170 | |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 322
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 190 | Source file "./test/johntest.py" The first line is 180 | |
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
|
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
Clone # 323
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 200 | Source file "./test/johntest.py" The first line is 190 | |
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
|
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
Clone # 324
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 210 | Source file "./test/johntest.py" The first line is 200 | |
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
|
def get_label(self, ch_index): if self.channel_list[ch_index].has_key(self._label): return self.channel_list[ch_index][self._label] return None |
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
Clone # 325
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 185 | Source file "./test/johntest.py" The first line is 170 | |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 326
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 195 | Source file "./test/johntest.py" The first line is 180 | |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
|
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
Clone # 327
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 205 | Source file "./test/johntest.py" The first line is 190 | |
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
|
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
Clone # 328
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 190 | Source file "./test/johntest.py" The first line is 170 | |
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 329
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 200 | Source file "./test/johntest.py" The first line is 180 | |
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
|
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
Clone # 330
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 210 | Source file "./test/johntest.py" The first line is 190 | |
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_arch(self, ch_index): if self.channel_list[ch_index].has_key(self._arch): return self.channel_list[ch_index][self._arch] return None |
|
def get_label(self, ch_index): if self.channel_list[ch_index].has_key(self._label): return self.channel_list[ch_index][self._label] return None |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
Clone # 331
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 195 | Source file "./test/johntest.py" The first line is 170 | |
def get_parent_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._parent_channel): return self.channel_list[ch_index][self._parent_channel] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 332
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 205 | Source file "./test/johntest.py" The first line is 180 | |
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
|
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
Clone # 333
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 200 | Source file "./test/johntest.py" The first line is 170 | |
def get_summary(self, ch_index): if self.channel_list[ch_index].has_key(self._summary): return self.channel_list[ch_index][self._summary] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 334
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 210 | Source file "./test/johntest.py" The first line is 180 | |
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_name(self, ch_index): if self.channel_list[ch_index].has_key(self._name): return self.channel_list[ch_index][self._name] return None |
|
def get_label(self, ch_index): if self.channel_list[ch_index].has_key(self._label): return self.channel_list[ch_index][self._label] return None |
def get_local_channel(self, ch_index): if self.channel_list[ch_index].has_key(self._local_channel): return self.channel_list[ch_index][self._local_channel] return None |
Clone # 335
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 205 | Source file "./test/johntest.py" The first line is 170 | |
def get_org_id(self, ch_index): if self.channel_list[ch_index].has_key(self._org_id): return self.channel_list[ch_index][self._org_id] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 336
Distance between two fragments = 4
Clone size = 8
Source file "./test/johntest.py" The first line is 210 | Source file "./test/johntest.py" The first line is 170 | |
def get_id(self, ch_index): if self.channel_list[ch_index].has_key(self._id): return self.channel_list[ch_index][self._id] return None |
def get_last_modified(self, ch_index): if self.channel_list[ch_index].has_key(self._last_modified): return self.channel_list[ch_index][self._last_modified] return None |
|
def get_label(self, ch_index): if self.channel_list[ch_index].has_key(self._label): return self.channel_list[ch_index][self._label] return None |
def get_description(self, ch_index): if self.channel_list[ch_index].has_key(self._description): return self.channel_list[ch_index][self._description] return None |
Clone # 337
Distance between two fragments = 3
Clone size = 8
Source file "./server/action/kickstart_guest.py" The first line is 49 | Source file "./server/action/kickstart_host.py" The first line is 40 | |
virt_host_package_name = 'rhn-virtualization-guest' | messaging_package_name = 'osad' | |
tools_channel = SubscribedChannel(server_id, 'rhn-tools') | tools_channel = SubscribedChannel(server_id, 'rhn-tools') | |
found_tools_channel = tools_channel.is_subscribed_to_channel() | found_tools_channel = tools_channel.is_subscribed_to_channel() | |
if not found_tools_channel: raise InvalidAction('System not subscribed to the RHN Tools channel.') |
if not found_tools_channel: raise InvalidAction('System not subscribed to the RHN Tools channel.') |
|
rhn_v12n_package = ChannelPackage(server_id, virt_host_package_name) | rhn_v12n_package = ChannelPackage(server_id, virt_host_package_name) | |
if not rhn_v12n_package.exists(): raise InvalidAction('Could not find the rhn-virtualization-guest package.') |
if not rhn_v12n_package.exists(): raise InvalidAction('Could not find the rhn-virtualization-host package.') |
Clone # 338
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/exporter/exportLib.py" The first line is 783 | Source file "./satellite_tools/exporter/exportLib.py" The first line is 718 | |
tag_name = 'rhn-source-packages' | tag_name = 'rhn-packages-short' | |
def set_iterator(self): if self._iterator: return self._iterator h = rhnSQL.prepare("\n select \n ps.id, \n sr.name source_rpm, \n pg.name package_group, \n ps.rpm_version, \n ps.payload_size,\n ps.build_host, \n TO_CHAR(ps.build_time, 'YYYYMMDDHH24MISS') build_time,\n sig.checksum sigchecksum,\n sig.checksum_type sigchecksum_type,\n ps.vendor,\n ps.cookie,\n ps.package_size,\n c.checksum_type,\n c.checksum,\n TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackageSource ps, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c, rhnChecksumView sig\n where ps.package_group = pg.id\n and ps.source_rpm_id = sr.id\n and ps.path is not null\n and ps.checksum_id = c.id\n and ps.sigchecksum_id = sig.id\n and rownum < 3\n ") h.execute() return h |
def set_iterator(self): if self._iterator: return self._iterator h = rhnSQL.prepare("\n select \n p.id, \n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n c.checksum_type,\n c.checksum,\n p.org_id,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnChecksumView c\n where p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.path is not null\n and p.checksum_id = c.id\n and rownum < 3\n ") h.execute() return h |
Clone # 339
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/exporter/exportLib.py" The first line is 783 | Source file "./satellite_tools/exporter/exportLib.py" The first line is 567 | |
tag_name = 'rhn-source-packages' | tag_name = 'rhn-packages' | |
def set_iterator(self): if self._iterator: return self._iterator h = rhnSQL.prepare("\n select \n ps.id, \n sr.name source_rpm, \n pg.name package_group, \n ps.rpm_version, \n ps.payload_size,\n ps.build_host, \n TO_CHAR(ps.build_time, 'YYYYMMDDHH24MISS') build_time,\n sig.checksum sigchecksum,\n sig.checksum_type sigchecksum_type,\n ps.vendor,\n ps.cookie,\n ps.package_size,\n c.checksum_type,\n c.checksum,\n TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackageSource ps, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c, rhnChecksumView sig\n where ps.package_group = pg.id\n and ps.source_rpm_id = sr.id\n and ps.path is not null\n and ps.checksum_id = c.id\n and ps.sigchecksum_id = sig.id\n and rownum < 3\n ") h.execute() return h |
def set_iterator(self): if self._iterator: return self._iterator h = rhnSQL.prepare("\n select \n p.id,\n p.org_id, \n pn.name, \n pe.evr.version version, \n pe.evr.release release, \n pe.evr.epoch epoch, \n pa.label package_arch,\n pg.name package_group, \n p.rpm_version, \n p.description,\n p.summary,\n p.package_size,\n p.payload_size,\n p.build_host, \n TO_CHAR(p.build_time, 'YYYYMMDDHH24MISS') build_time,\n sr.name source_rpm, \n c.checksum_type,\n c.checksum,\n p.vendor,\n p.payload_format, \n p.compat, \n p.header_sig,\n p.copyright,\n p.cookie,\n p.header_start,\n p.header_end,\n TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified\n from rhnPackage p, rhnPackageName pn, rhnPackageEVR pe, \n rhnPackageArch pa, rhnPackageGroup pg, rhnSourceRPM sr,\n rhnChecksumView c\n where p.name_id = pn.id\n and p.evr_id = pe.id\n and p.package_arch_id = pa.id\n and p.package_group = pg.id\n and p.source_rpm_id = sr.id\n and p.path is not null\n and p.checksum_id = c.id\n and rownum < 3\n ") h.execute() return h |
Clone # 340
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/satComputePkgHeaders.py" The first line is 168 | Source file "./satellite_tools/sync_handlers.py" The first line is 728 | |
h.execute() | h.execute() | |
ret = {} | cfs = {} | |
while 1: row = h.fetchone_dict() if not row: break ret[row['label']] = row['id'] |
while 1: row = h.fetchone_dict() if not row: break cfs[row['label']] = 1 |
|
return ret | return cfs |
Clone # 341
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/satComputePkgHeaders.py" The first line is 167 | Source file "./server/apacheHandler.py" The first line is 158 | |
h = rhnSQL.prepare(self._query_get_channels) | h = rhnSQL.prepare('select label, value from rhnTemplateString') | |
h.execute() | h.execute() | |
ret = {} | templateStrings = {} | |
while 1: row = h.fetchone_dict() if not row: break ret[row['label']] = row['id'] |
while 1: row = h.fetchone_dict() if not row: break templateStrings[row['label']] = row['value'] |
Clone # 342
Distance between two fragments = 2
Clone size = 8
Source file "./server/test/unit-test/test_server_registration.py" The first line is 118 | Source file "./server/test/unit-test/test_server_registration.py" The first line is 74 | |
system_id = register_new_system(params) | system_id = register_new_system(params) | |
rhnSQL.commit() | rhnSQL.commit() | |
s = rhnServer.get(system_id) | s = rhnServer.get(system_id) | |
self.assertNotEqual(s, None) | self.assertNotEqual(s, None) | |
server_id = s.getid() | server_id = s.getid() | |
channels = rhnChannel.channels_for_server(server_id) | channels = rhnChannel.channels_for_server(server_id) | |
self.assertEqual(len(channels), 1) | self.assertEqual(len(channels), 1) | |
self.assertEqual(channels[0]['label'], base_channel) | self.assertEqual(channels[0]['label'], self._channel) |
Clone # 343
Distance between two fragments = 2
Clone size = 8
Source file "./server/handlers/xmlrpc/up2date.py" The first line is 182 | Source file "./server/handlers/xmlrpc/up2date.py" The first line is 166 | |
transport = rhnFlags.get('outputTransportOptions') | transport = rhnFlags.get('outputTransportOptions') | |
transport['X-RHN-Action'] = 'unsubscribeChannel' | transport['X-RHN-Action'] = 'subscribeChannel' | |
self.auth_system(system_id) | self.auth_system(system_id) | |
log_debug(1, self.server_id, channelNames) | log_debug(1, self.server_id, channelNames) | |
for channelName in channelNames: rhnChannel.unsubscribe_channel(self.server_id, channelName, username, passwd) |
for channelName in channelNames: rhnChannel.subscribe_channel(self.server_id, channelName, username, passwd) |
|
return 0 | return 0 |
Clone # 344
Distance between two fragments = 2
Clone size = 8
Source file "./satellite_tools/satsync.py" The first line is 1848 | Source file "./satellite_tools/satsync.py" The first line is 1405 | |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) sync_handlers.import_errata(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
while not ss.doneYN(): chunk = ss.getChunk() item_count = len(chunk) stream_loader.process(chunk) ss.clearChunk() pb.addTo(item_count) pb.printIncrement() |
|
pb.printComplete() | pb.printComplete() |
Clone # 345
Distance between two fragments = 1
Clone size = 8
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 314 | Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 251 | |
db_last_modified = int(rhnLib_common.timestamp(channel_obj['last_modified'])) | db_last_modified = int(rhnLib.timestamp(channel_obj['last_modified'])) | |
last_modified = int(rhnLib_common.timestamp(last_modified)) | last_modified = int(rhnLib.timestamp(last_modified)) | |
log_debug(3, 'last modified', last_modified, 'db last modified', db_last_modified) | log_debug(3, 'last modified', last_modified, 'db last modified', db_last_modified) | |
if last_modified != db_last_modified: raise rhnFault(3013, 'The requested channel version does not match the upstream version', explain=0) |
if last_modified != db_last_modified: raise rhnFault(3013, 'The requested channel version does not match the upstream version', explain=0) |
|
channel_id = channel_obj['channel_id'] | channel_id = channel_obj['channel_id'] |
Clone # 346
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 403 | Source file "./satellite_exporter/handlers/non_auth_dumper.py" The first line is 367 | |
erratum = str(erratum) | package = str(package) | |
if erratum[:len(prefix)] != prefix: raise rhnFault(3004, ('Wrong erratum name %s') % (erratum)) |
if package[:len(prefix)] != prefix: raise rhnFault(3002, ('Invalid package name %s') % (package)) |
|
errata_id = erratum[len(prefix):] | package_id = package[len(prefix):] | |
try: errata_id = int(errata_id) except ValueError: raise rhnFault(3004, ('Wrong erratum name %s') % (erratum)) |
try: package_id = int(package_id) except ValueError: raise rhnFault(3002, ('Invalid package name %s') % (package)) |
Clone # 347
Distance between two fragments = 4
Clone size = 8
Source file "./server/handlers/xmlrpc/registration.py" The first line is 1348 | Source file "./server/handlers/xmlrpc/registration.py" The first line is 1178 | |
user = rhnUser.search(username) | user = rhnUser.search(username) | |
if user is None: log_error('invalid username', username) raise rhnFault(2) |
if user is None: log_error('invalid username', username) raise rhnFault(2) |
|
if not user.check_password(password): log_error('User password check failed', username) raise rhnFault(2) |
if not user.check_password(password): log_error('User password check failed', username) raise rhnFault(2) |
|
server_arch = normalize_server_arch(arch) | val = contact_info.get('state') |
Clone # 348
Distance between two fragments = 0
Clone size = 8
Source file "./server/test/unit-test/rhnSQL/test_executemany.py" The first line is 30 | Source file "./server/test/unit-test/rhnSQL/test_1.py" The first line is 28 | |
def _cleanup(self): try: rhnSQL.execute(('drop table %s') % (self.table_name)) except rhnSQL.SQLStatementPrepareError: pass |
def _cleanup(self): try: rhnSQL.execute(('drop table %s') % (self.table_name)) except rhnSQL.SQLStatementPrepareError: pass |
|
def tearDown(self): self._cleanup() rhnSQL.commit() |
def tearDown(self): self._cleanup() rhnSQL.commit() |
Clone # 349
Distance between two fragments = 0
Clone size = 8
Source file "./server/rhnActivationKey.py" The first line is 325 | Source file "./server/rhnServerGroup.py" The first line is 98 | |
def startswith(s, prefix): return s[:len(prefix)] == prefix |
def startswith(s, prefix): return s[:len(prefix)] == prefix |
|
class CallableObj: def __init__(self, name, func): self.func = func self.name = name def __call__(self, *args, **kwargs): return apply(self.func, ((self.name)) + (args), kwargs) |
class CallableObj: def __init__(self, name, func): self.func = func self.name = name def __call__(self, *args, **kwargs): return apply(self.func, ((self.name)) + (args), kwargs) |
Clone # 350
Distance between two fragments = 3
Clone size = 8
Source file "./satellite_tools/diskImportLib.py" The first line is 149 | Source file "./satellite_tools/diskImportLib.py" The first line is 140 | |
class ProductNamesContainer(xmlSource.ProductNamesContainer): def endContainerCallback(self): if not self.batch: return None importer = productNamesImport.ProductNamesImport(self.batch, get_backend()) importer.run() self.batch = [] |
class BlacklistObsoletesContainer(xmlSource.BlacklistObsoletesContainer): def endContainerCallback(self): if not self.batch: return None importer = blacklistImport.BlacklistObsoletesImport(self.batch, get_backend()) importer.run() self.batch = [] |
Clone # 351
Distance between two fragments = 3
Clone size = 8
Source file "./server/handlers/app/packages.py" The first line is 204 | Source file "./server/handlers/app/packages.py" The first line is 149 | |
def listMissingSourcePackages(self, channelList, username, password): log_debug(5, channelList, username) authobj = auth(username, password) return self._listMissingSourcePackages(authobj, channelList) |
def listChannel(self, channelList, username, password): log_debug(5, channelList, username) authobj = auth(username, password) return self._listChannel(authobj, channelList) |
|
def listMissingSourcePackagesBySession(self, channelList, session_string): log_debug(5, channelList, session_string) authobj = auth_session(session_string) return self._listMissingSourcePackages(authobj, channelList) |
def listChannelBySession(self, channelList, session_string): log_debug(5, channelList, session_string) authobj = auth_session(session_string) return self._listChannel(authobj, channelList) |
Clone # 352
Distance between two fragments = 3
Clone size = 8
Source file "./server/handlers/app/packages.py" The first line is 204 | Source file "./server/handlers/app/packages.py" The first line is 133 | |
def listMissingSourcePackages(self, channelList, username, password): log_debug(5, channelList, username) authobj = auth(username, password) return self._listMissingSourcePackages(authobj, channelList) |
def listChannelSource(self, channelList, username, password): log_debug(5, channelList, username) authobj = auth(username, password) return self._listChannelSource(authobj, channelList) |
|
def listMissingSourcePackagesBySession(self, channelList, session_string): log_debug(5, channelList, session_string) authobj = auth_session(session_string) return self._listMissingSourcePackages(authobj, channelList) |
def listChannelSourceBySession(self, channelList, session_string): log_debug(5, channelList, session_string) authobj = auth_session(session_string) return self._listChannelSource(authobj, channelList) |
Clone # 353
Distance between two fragments = 3
Clone size = 8
Source file "./server/handlers/app/packages.py" The first line is 149 | Source file "./server/handlers/app/packages.py" The first line is 133 | |
def listChannel(self, channelList, username, password): log_debug(5, channelList, username) authobj = auth(username, password) return self._listChannel(authobj, channelList) |
def listChannelSource(self, channelList, username, password): log_debug(5, channelList, username) authobj = auth(username, password) return self._listChannelSource(authobj, channelList) |
|
def listChannelBySession(self, channelList, session_string): log_debug(5, channelList, session_string) authobj = auth_session(session_string) return self._listChannel(authobj, channelList) |
def listChannelSourceBySession(self, channelList, session_string): log_debug(5, channelList, session_string) authobj = auth_session(session_string) return self._listChannelSource(authobj, channelList) |
Clone # 354
Distance between two fragments = 3
Clone size = 8
Source file "./server/handlers/app/packages.py" The first line is 112 | Source file "./server/handlers/app/packages.py" The first line is 88 | |
def uploadSourcePackageInfo(self, username, password, info): log_debug(5, username, info) authobj = auth(username, password) return self._uploadSourcePackageInfo(authobj, info) |
def uploadPackageInfo(self, username, password, info): log_debug(5, username, info) authobj = auth(username, password) return self._uploadPackageInfo(authobj, info) |
|
def uploadSourcePackageInfoBySession(self, session_string, info): log_debug(5, session_string) authobj = auth_session(session_string) return self._uploadSourcePackageInfo(authobj, info) |
def uploadPackageInfoBySession(self, session_string, info): log_debug(5, session_string) authobj = auth_session(session_string) return self._uploadPackageInfo(authobj, info) |
Clone # 355
Distance between two fragments = 2
Clone size = 8
Source file "./server/rhnServer/server_kickstart.py" The first line is 229 | Source file "./server/rhnServer/server_kickstart.py" The first line is 198 | |
row = get_kickstart_session_info(kickstart_session_id, server_id) | row = get_kickstart_session_info(kickstart_session_id, server_id) | |
org_id = row['org_id'] | org_id = row['org_id'] | |
scheduler = row['scheduler'] | scheduler = row['scheduler'] | |
action_id = rhnAction.schedule_server_action(server_id, action_type='kickstart.schedule_sync', action_name='Schedule a package sync', delta_time=0, scheduler=scheduler, org_id=org_id) | action_id = rhnAction.schedule_server_action(server_id, action_type='packages.runTransaction', action_name='Package delta', delta_time=0, scheduler=scheduler, org_id=org_id) |
Clone # 356
Distance between two fragments = 4
Clone size = 7
Source file "./server/handlers/config_mgmt/rhn_config_management.py" The first line is 92 | Source file "./server/handlers/config/rhn_config_management.py" The first line is 296 | |
insert_call = rhnSQL.Function('rhn_config.insert_channel', rhnSQL.types.NUMBER()) | insert_call = rhnSQL.Function('rhn_config.insert_channel', rhnSQL.types.NUMBER()) | |
config_channel_id = insert_call(self.org_id, 'normal', config_channel_name, config_channel, config_channel_description) | config_channel_id = insert_call(self.org_id, 'server_import', name, label, description) |
Clone # 357
Distance between two fragments = 0
Clone size = 7
Source file "./server/test/test_xmlrpc_up2date.py" The first line is 39 | Source file "./server/test/test_solve_dependencies.py" The first line is 40 | |
self.directory = '/home/devel/wregglej/testrpms' | self.directory = '/home/devel/wregglej/testrpms' | |
self.filename = 'libcaps.so' | self.filename = 'libcaps.so' | |
self.arch = 'i386' | self.arch = 'i386' | |
self.myserver = TestServer() | self.myserver = TestServer() | |
self.serv_id = self.myserver.getServerId() | self.serv_id = self.myserver.getServerId() | |
self.myserver.upload_packages(self.directory) | self.myserver.upload_packages(self.directory) | |
self.up2date = self.myserver.getUp2date() | self.up2date = self.myserver.getUp2date() |
Clone # 358
Distance between two fragments = 4
Clone size = 7
Source file "./server/importlib/backend.py" The first line is 1010 | Source file "./server/importlib/backend.py" The first line is 925 | |
if not virt_labels: return None |
if not c_ids: return None |
|
hdel = self.dbmodule.prepare('\n delete from rhnVirtSubLevel\n where label = :vsl_label\n ') | hdel = self.dbmodule.prepare('\n delete from rhnChannelFamilyMembers\n where channel_id = :channel_id\n ') | |
hins = self.dbmodule.prepare('\n insert into rhnVirtSubLevel \n (label, name)\n values (:vsl_label, :vsl_text)\n ') | hins = self.dbmodule.prepare('\n insert into rhnChannelFamilyMembers (channel_id, channel_family_id)\n values (:channel_id, :channel_family_id)\n ') | |
hdel.executemany(vsl_label=virt_labels) | hdel.executemany(channel_id=c_ids) |
Clone # 359
Distance between two fragments = 4
Clone size = 7
Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 241 | Source file "./server/test/unit-test/test_rhnChannel.py" The first line is 205 | |
if not hasattr(self, '_counter'): self._counter = 0 |
if not hasattr(self, '_counter'): self._counter = 0 |
|
label = kwargs.get('label') | label = kwargs.get('label') | |
if label is None: label = ('rhn-unittest-%.3f-%s') % ((time.time(), self._counter)) self._counter = (self._counter) + (1) |
if label is None: label = ('rhn-unittest-%.3f-%s') % ((time.time(), self._counter)) self._counter = (self._counter) + (1) |
|
product_url = (kwargs.get('product_url')) or ('http://rhn.redhat.com') | release = (kwargs.get('release')) or (('release-') + (label)) |
Clone # 360
Distance between two fragments = 2
Clone size = 7
Source file "./server/rhnVirtualization.py" The first line is 681 | Source file "./server/rhnVirtualization.py" The first line is 489 | |
if new_values_array: new_values = string.join(new_values_array, ', ') bindings['row_id'] = existing_row['instance_id'] update_sql = ('\n UPDATE rhnVirtualInstanceInfo SET %s WHERE instance_id=:row_id\n ') % (new_values) query = rhnSQL.prepare(update_sql) query.execute(, **bindings) |
if new_values_array: new_values = string.join(new_values_array, ', ') bindings['row_id'] = existing_row['id'] update_sql = ('\n UPDATE rhnVirtualInstance SET %s WHERE id=:row_id\n ') % (new_values) query = rhnSQL.prepare(update_sql) query.execute(, **bindings) |
Clone # 361
Distance between two fragments = 2
Clone size = 7
Source file "./server/rhnDependency.py" The first line is 349 | Source file "./server/rhnDependency.py" The first line is 340 | |
holder[1] = string.split(holder[1], '-') | holder[0] = string.split(holder[0], '-') | |
ret = {'name': '-'.join(holder[1][:-2]), 'version': holder[1][-2], 'release': holder[1][-1], 'epoch': holder[0]} | ret = {'name': '-'.join(holder[0][:-2]), 'version': holder[0][-2], 'release': holder[0][-1], 'epoch': holder[1]} | |
return ret | return ret |
Clone # 362
Distance between two fragments = 4
Clone size = 8
Source file "./server/repomd/view.py" The first line is 233 | Source file "./server/repomd/view.py" The first line is 164 | |
def write_start(self): output = (((XML_ENCODING) + ('\n')) + (' self.fileobj.write(output) |
def write_start(self): output = ((((XML_ENCODING) + ('\n')) + (' self.fileobj.write(output) |
|
def write_package(self, package): self.fileobj.write('\n'.join(self._get_package(package))) |
def write_package(self, package): self.fileobj.write('\n'.join(self._get_package(package))) |
Clone # 363
Distance between two fragments = 4
Clone size = 8
Source file "./server/repomd/view.py" The first line is 197 | Source file "./server/repomd/view.py" The first line is 164 | |
def write_start(self): output = (((XML_ENCODING) + ('\n')) + (' self.fileobj.write(output) |
def write_start(self): output = ((((XML_ENCODING) + ('\n')) + (' self.fileobj.write(output) |
|
def write_package(self, package): self.fileobj.write('\n'.join(self._get_package(package))) |
def write_package(self, package): self.fileobj.write('\n'.join(self._get_package(package))) |
Clone # 364
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/xmlSource.py" The first line is 651 | Source file "./satellite_tools/xmlSource.py" The first line is 634 | |
addItem(ChannelErratumItem) | addItem(FileItem) | |
class ReleaseItem(BaseItem): item_name = 'rhn-release' item_class = importLib.ReleaseChannelMap tagMap = {'channel-arch': 'channel_arch'} |
class DistItem(BaseItem): item_name = 'rhn-dist' item_class = importLib.DistChannelMap tagMap = {'channel-arch': 'channel_arch'} |
|
addItem(ReleaseItem) | addItem(DistItem) |
Clone # 365
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/xmlSource.py" The first line is 615 | Source file "./satellite_tools/xmlSource.py" The first line is 591 | |
addItem(ConflictsItem) | addItem(ChangelogItem) | |
class ObsoletesItem(BaseItem): item_name = 'rhn-package-obsoletes-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
class ProvidesItem(BaseItem): item_name = 'rhn-package-provides-entry' item_class = importLib.Dependency tagMap = {'sense': 'flags'} |
|
addItem(ObsoletesItem) | addItem(ProvidesItem) |
Clone # 366
Distance between two fragments = 1
Clone size = 7
Source file "./server/handlers/config_mgmt/rhn_config_management.py" The first line is 348 | Source file "./server/handlers/config_mgmt/rhn_config_management.py" The first line is 216 | |
log_debug(1) | log_debug(1) | |
session = dict.get('session') | session = dict.get('session') | |
self._validate_session(session) | self._validate_session(session) | |
config_channel = dict.get('config_channel') | config_channel = dict.get('config_channel') | |
path = dict.get('path') | path = dict.get('path') | |
h = rhnSQL.prepare(self._query_lookup_config_file_by_channel) | h = rhnSQL.prepare(self._query_list_file_revisions) | |
h.execute(org_id=self.org_id, config_channel=config_channel, path=path) | h.execute(org_id=self.org_id, config_channel=config_channel, path=path) |
Clone # 367
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 463 | Source file "./satellite_tools/satComputePkgHeaders.py" The first line is 168 | |
h.execute() | h.execute() | |
all_channels_hash = {} | ret = {} | |
while 1: row = h.fetchone_dict() if not row: break all_channels_hash[row['label']] = row |
while 1: row = h.fetchone_dict() if not row: break ret[row['label']] = row['id'] |
Clone # 368
Distance between two fragments = 2
Clone size = 7
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 463 | Source file "./satellite_tools/sync_handlers.py" The first line is 728 | |
h.execute() | h.execute() | |
all_channels_hash = {} | cfs = {} | |
while 1: row = h.fetchone_dict() if not row: break all_channels_hash[row['label']] = row |
while 1: row = h.fetchone_dict() if not row: break cfs[row['label']] = 1 |
Clone # 369
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/dumper.py" The first line is 463 | Source file "./server/apacheHandler.py" The first line is 159 | |
h.execute() | h.execute() | |
all_channels_hash = {} | templateStrings = {} | |
while 1: row = h.fetchone_dict() if not row: break all_channels_hash[row['label']] = row |
while 1: row = h.fetchone_dict() if not row: break templateStrings[row['label']] = row['value'] |
Clone # 370
Distance between two fragments = 1
Clone size = 7
Source file "./server/rhnDependency.py" The first line is 516 | Source file "./server/rhnDependency.py" The first line is 720 | |
if len(dict) > 1: matches = dict.keys() compats = filter(lambda a: a[:7] == 'compat-', matches) if (len(compats) > 0) and (len(compats) < len(matches)): for p in compats: dict[p] |
if len(dict) > 1: matches = dict.keys() compats = filter(lambda a: a[:7] == 'compat-', matches) if (len(compats) > 0) and (len(compats) < len(matches)): for p in compats: dict[p] |
|
list_of_tuples = dict.values() | l = dict.values() |
Clone # 371
Distance between two fragments = 0
Clone size = 7
Source file "./server/rhnDependency.py" The first line is 516 | Source file "./server/rhnDependency.py" The first line is 635 | |
if len(dict) > 1: matches = dict.keys() compats = filter(lambda a: a[:7] == 'compat-', matches) if (len(compats) > 0) and (len(compats) < len(matches)): for p in compats: dict[p] |
if len(dict) > 1: matches = dict.keys() compats = filter(lambda a: a[:7] == 'compat-', matches) if (len(compats) > 0) and (len(compats) < len(matches)): for p in compats: dict[p] |
|
list_of_tuples = dict.values() | list_of_tuples = dict.values() |
Clone # 372
Distance between two fragments = 3
Clone size = 8
Source file "./server/rhnDependency.py" The first line is 682 | Source file "./server/rhnDependency.py" The first line is 430 | |
deplist = [] | deplist = [] | |
for dep in deps: if dep not in deplist: deplist.append(dep) |
for dep in deps: if dep not in deplist: deplist.append(dep) |
|
statement = ('%s UNION ALL %s UNION ALL %s') % ((__packages_sql, __provides_sql, __files_sql)) | statement = ('%s UNION ALL %s UNION ALL %s') % ((__packages_all_sql, __provides_all_sql, __files_all_sql)) | |
h = rhnSQL.prepare(statement) | h = rhnSQL.prepare(statement) | |
packages = {} | packages = {} |
Clone # 373
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satComputePkgHeaders.py" The first line is 170 | Source file "./server/rhnActivationKey.py" The first line is 156 | |
ret = {} | ret = {} | |
while 1: row = h.fetchone_dict() if not row: break ret[row['label']] = row['id'] |
while 1: row = h.fetchone_dict() if not row: break ret[row['label']] = None |
|
return ret | return ret |
Clone # 374
Distance between two fragments = 2
Clone size = 7
Source file "./satellite_tools/sync_handlers.py" The first line is 730 | Source file "./server/rhnActivationKey.py" The first line is 156 | |
cfs = {} | ret = {} | |
while 1: row = h.fetchone_dict() if not row: break cfs[row['label']] = 1 |
while 1: row = h.fetchone_dict() if not row: break ret[row['label']] = None |
|
return cfs | return ret |
Clone # 375
Distance between two fragments = 0
Clone size = 7
Source file "./server/rhnDependency.py" The first line is 700 | Source file "./server/rhnDependency.py" The first line is 608 | |
dict = {} | dict = {} | |
h.execute(server_id=server_id, dep=dep) | h.execute(server_id=server_id, dep=dep) | |
rs = (h.fetchall_dict()) or ([]) | rs = (h.fetchall_dict()) or ([]) | |
if not rs: log_error('Unable to solve dependency', server_id, dep) packages[dep] = [] continue |
if not rs: log_error('Unable to solve dependency', server_id, dep) packages[dep] = [] continue |
Clone # 376
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/reposync.py" The first line is 250 | Source file "./server/action/utils.py" The first line is 109 | |
self.checksum = None | self.package_name = package_name | |
self.unique_id = None | self.package_info = None | |
self.name = None | self.id = None | |
self.version = None | self.version = None | |
self.release = None | self.release = None | |
self.epoch = None | self.epoch = None | |
self.arch = None | self.arch = None |
Clone # 377
Distance between two fragments = 2
Clone size = 7
Source file "./server/rhnChannel.py" The first line is 1247 | Source file "./server/rhnChannel.py" The first line is 1408 | |
log_debug(3, channel_id) | log_debug(3, channel_id) | |
h = rhnSQL.prepare('\n select\n pn.name, \n pevr.version, \n pevr.release, \n pevr.epoch, \n pa.label arch, \n p.package_size \n from \n rhnChannelPackage cp,\n rhnPackage p,\n rhnPackageName pn,\n rhnPackageEVR pevr,\n rhnPackageArch pa\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n and p.name_id = pn.id\n and p.evr_id = pevr.id\n and p.package_arch_id = pa.id\n order by pn.name, pevr.evr desc, pa.label\n ') | h = rhnSQL.prepare('\n select\n p.path\n from \n rhnPackage p,\n rhnChannelPackage cp\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n ') | |
h.execute(channel_id=str(channel_id)) | h.execute(channel_id=str(channel_id)) | |
ret = h.fetchall_dict() | ret = h.fetchall() | |
if not ret: return [] |
if not ret: return [] |
Clone # 378
Distance between two fragments = 2
Clone size = 7
Source file "./server/rhnChannel.py" The first line is 1174 | Source file "./server/rhnChannel.py" The first line is 1408 | |
log_debug(3, channel_id) | log_debug(3, channel_id) | |
h = rhnSQL.prepare("\n select\n pn.name, \n pevr.version, \n pevr.release, \n pevr.epoch, \n pa.label arch, \n full_channel.package_size \n from \n rhnPackageArch pa,\n ( select \n p.name_id,\n max(pe.evr) evr\n from\n rhnChannelPackage cp,\n rhnPackage p,\n rhnPackageEVR pe\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n and p.evr_id = pe.id\n group by p.name_id\n ) listall,\n ( select distinct\n p.package_size,\n p.name_id,\n p.evr_id,\n p.package_arch_id\n from\n rhnChannelPackage cp,\n rhnPackage p\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n ) full_channel,\n -- Rank the package's arch\n ( select\n package_arch_id, \n count(*) rank\n from\n rhnServerPackageArchCompat\n group by package_arch_id\n ) arch_rank,\n rhnPackageName pn,\n rhnPackageEVR pevr\n where\n pn.id = listall.name_id\n -- link back to the specific package\n and full_channel.name_id = listall.name_id\n and full_channel.evr_id = pevr.id\n and pevr.evr = listall.evr\n and pa.id = full_channel.package_arch_id\n and pa.id = arch_rank.package_arch_id\n order by pn.name, arch_rank.rank desc\n ") | h = rhnSQL.prepare('\n select\n p.path\n from \n rhnPackage p,\n rhnChannelPackage cp\n where\n cp.channel_id = :channel_id\n and cp.package_id = p.id\n ') | |
h.execute(channel_id=str(channel_id)) | h.execute(channel_id=str(channel_id)) | |
ret = h.fetchall_dict() | ret = h.fetchall() | |
if not ret: return [] |
if not ret: return [] |
Clone # 379
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/sync_handlers.py" The first line is 363 | Source file "./satellite_tools/sync_handlers.py" The first line is 249 | |
def get_erratum(self, erratum_id, timestamp): return self._cache.cache_get(erratum_id, timestamp=timestamp) |
def get_package(self, package_id, timestamp): return self._cache.cache_get(package_id, timestamp=timestamp) |
|
def has_erratum(self, erratum_id, timestamp): return self._cache.cache_has_key(erratum_id, timestamp=timestamp) |
def has_package(self, package_id, timestamp): return self._cache.cache_has_key(package_id, timestamp=timestamp) |
|
def reset(self): self._shared_state.clear() self.__init__() |
def reset(self): self._shared_state.clear() self.__init__() |
Clone # 380
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1653 | Source file "./satellite_tools/satsync.py" The first line is 1270 | |
h = sync_handlers.get_errata_handler() | h = sync_handlers.get_source_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.ErrataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getErrataXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.SourcePackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getSourcePackageXmlStream stream_loader.set_wire_loader(s) |
Clone # 381
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1653 | Source file "./satellite_tools/satsync.py" The first line is 1094 | |
h = sync_handlers.get_errata_handler() | h = sync_handlers.get_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.ErrataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getErrataXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.PackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getPackageXmlStream stream_loader.set_wire_loader(s) |
Clone # 382
Distance between two fragments = 4
Clone size = 7
Source file "./server/rhnActivationKey.py" The first line is 291 | Source file "./server/rhnActivationKey.py" The first line is 266 | |
token_id = self._row_reg_token['id'] | token_id = self._row_reg_token['id'] | |
inserts, deletes = self._diff_hashes(db_channels, self._channels) | inserts, deletes = self._diff_hashes(db_server_groups, self._server_groups) | |
if deletes: token_ids = ([token_id]) * (len(deletes)) h = rhnSQL.prepare(self._query_delete_channels) h.executemany(token_id=token_ids, channel_id=deletes) |
if deletes: token_ids = ([token_id]) * (len(deletes)) h = rhnSQL.prepare(self._query_delete_groups) h.executemany(token_id=token_ids, server_group_id=deletes) |
Clone # 383
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1653 | Source file "./satellite_tools/satsync.py" The first line is 1381 | |
h = sync_handlers.get_errata_handler() | h = sync_handlers.get_kickstarts_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.ErrataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getErrataXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.KickstartDataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getKickstartsXmlStream stream_loader.set_wire_loader(s) |
Clone # 384
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1653 | Source file "./satellite_tools/satsync.py" The first line is 861 | |
h = sync_handlers.get_errata_handler() | h = sync_handlers.get_short_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.ErrataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getErrataXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.ShortPackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getChannelShortPackagesXmlStream stream_loader.set_wire_loader(s) |
Clone # 385
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1381 | Source file "./satellite_tools/satsync.py" The first line is 1270 | |
h = sync_handlers.get_kickstarts_handler() | h = sync_handlers.get_source_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.KickstartDataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getKickstartsXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.SourcePackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getSourcePackageXmlStream stream_loader.set_wire_loader(s) |
Clone # 386
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1381 | Source file "./satellite_tools/satsync.py" The first line is 1094 | |
h = sync_handlers.get_kickstarts_handler() | h = sync_handlers.get_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.KickstartDataDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getKickstartsXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.PackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getPackageXmlStream stream_loader.set_wire_loader(s) |
Clone # 387
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1270 | Source file "./satellite_tools/satsync.py" The first line is 861 | |
h = sync_handlers.get_source_package_handler() | h = sync_handlers.get_short_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.SourcePackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getSourcePackageXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.ShortPackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getChannelShortPackagesXmlStream stream_loader.set_wire_loader(s) |
Clone # 388
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/satsync.py" The first line is 1094 | Source file "./satellite_tools/satsync.py" The first line is 861 | |
h = sync_handlers.get_package_handler() | h = sync_handlers.get_short_package_handler() | |
stream_loader = StreamProducer(h) | stream_loader = StreamProducer(h) | |
if self.mountpoint: s = xmlDiskSource.PackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getPackageXmlStream stream_loader.set_wire_loader(s) |
if self.mountpoint: s = xmlDiskSource.ShortPackageDiskSource(self.mountpoint) stream_loader.set_disk_loader(s) else: s = self.xmlWireServer.getChannelShortPackagesXmlStream stream_loader.set_wire_loader(s) |
Clone # 389
Distance between two fragments = 4
Clone size = 8
Source file "./server/test/unit-test/test_misc_functions.py" The first line is 105 | Source file "./server/test/unit-test/test_misc_functions.py" The first line is 85 | |
quantity = 17 | quantity = 19 | |
misc_functions.grant_entitlements(org_id, entitlement_level, quantity) | misc_functions.grant_channel_family_entitlements(org_id, channel_family, quantity) | |
h = rhnSQL.prepare('\n select sg.max_members quantity\n from rhnServerGroupType sgt, rhnServerGroup sg\n where sg.org_id = :org_id\n and sg.group_type = sgt.id\n and sgt.label = :entitlement_level\n ') | h = rhnSQL.prepare('\n select cfp.max_members\n from rhnChannelFamily cf, rhnChannelFamilyPermissions cfp\n where cfp.org_id = :org_id\n and cfp.channel_family_id = cf.id\n and cf.label = :channel_family\n ') | |
h.execute(org_id=org_id, entitlement_level=entitlement_level) | h.execute(org_id=org_id, channel_family=channel_family) | |
row = h.fetchone_dict() | row = h.fetchone_dict() | |
self.assertNotEqual(row, None) | self.assertNotEqual(row, None) |
Clone # 390
Distance between two fragments = 2
Clone size = 7
Source file "./server/test/test_solve_dependencies.py" The first line is 201 | Source file "./server/test/test_solve_dependencies.py" The first line is 193 | |
def testMakeEvr1(self): nlimitstr = 'mozilla-1.5-2.rhfc1.dag:38' nlimit = rhnDependency.make_evr(nlimitstr) assert (nlimit['epoch'] == '38') and (nlimit['name'] == 'mozilla') and (nlimit['version'] == '1.5') and (nlimit['release'] == '2.rhfc1.dag') |
def testMakeEvr(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) assert (nlimit['epoch'] == '38') and (nlimit['name'] == 'mozilla') and (nlimit['version'] == '1.5') and (nlimit['release'] == '2.rhfc1.dag') |
Clone # 391
Distance between two fragments = 3
Clone size = 7
Source file "./server/test/test_solve_dependencies.py" The first line is 209 | Source file "./server/test/test_solve_dependencies.py" The first line is 201 | |
def testMakeEvr2(self): nlimitstr = 'mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) assert (nlimit['epoch'] == None) and (nlimit['name'] == 'mozilla') and (nlimit['version'] == '1.5') and (nlimit['release'] == '2.rhfc1.dag') |
def testMakeEvr1(self): nlimitstr = 'mozilla-1.5-2.rhfc1.dag:38' nlimit = rhnDependency.make_evr(nlimitstr) assert (nlimit['epoch'] == '38') and (nlimit['name'] == 'mozilla') and (nlimit['version'] == '1.5') and (nlimit['release'] == '2.rhfc1.dag') |
Clone # 392
Distance between two fragments = 3
Clone size = 7
Source file "./server/test/test_solve_dependencies.py" The first line is 209 | Source file "./server/test/test_solve_dependencies.py" The first line is 193 | |
def testMakeEvr2(self): nlimitstr = 'mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) assert (nlimit['epoch'] == None) and (nlimit['name'] == 'mozilla') and (nlimit['version'] == '1.5') and (nlimit['release'] == '2.rhfc1.dag') |
def testMakeEvr(self): nlimitstr = '38:mozilla-1.5-2.rhfc1.dag' nlimit = rhnDependency.make_evr(nlimitstr) assert (nlimit['epoch'] == '38') and (nlimit['name'] == 'mozilla') and (nlimit['version'] == '1.5') and (nlimit['release'] == '2.rhfc1.dag') |
Clone # 393
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/xmlDiskSource.py" The first line is 210 | Source file "./satellite_tools/xmlDiskSource.py" The first line is 96 | |
class BlacklistsDiskSource(DiskSource): subdir = 'blacklists' def _getFile(self, create=0): dirname = self._getDir(create) if (create) and (not os.path.isdir(dirname)): createPath(dirname, logging=0) return ('%s/blacklists.xml') % (dirname) |
class ChannelFamilyDiskSource(DiskSource): subdir = 'channel_families' def _getFile(self, create=0): dirname = self._getDir(create) if (create) and (not os.path.isdir(dirname)): createPath(dirname, logging=0) return ('%s/channel_families.xml') % (dirname) |
Clone # 394
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/xmlDiskSource.py" The first line is 210 | Source file "./satellite_tools/xmlDiskSource.py" The first line is 85 | |
class BlacklistsDiskSource(DiskSource): subdir = 'blacklists' def _getFile(self, create=0): dirname = self._getDir(create) if (create) and (not os.path.isdir(dirname)): createPath(dirname, logging=0) return ('%s/blacklists.xml') % (dirname) |
class ProductnamesDiskSource(DiskSource): subdir = 'product_names' def _getFile(self, create=0): dirname = self._getDir(create) if (create) and (not os.path.isdir(dirname)): createPath(dirname, logging=0) return ('%s/product_names.xml') % (dirname) |
Clone # 395
Distance between two fragments = 3
Clone size = 7
Source file "./satellite_tools/xmlDiskSource.py" The first line is 96 | Source file "./satellite_tools/xmlDiskSource.py" The first line is 85 | |
class ChannelFamilyDiskSource(DiskSource): subdir = 'channel_families' def _getFile(self, create=0): dirname = self._getDir(create) if (create) and (not os.path.isdir(dirname)): createPath(dirname, logging=0) return ('%s/channel_families.xml') % (dirname) |
class ProductnamesDiskSource(DiskSource): subdir = 'product_names' def _getFile(self, create=0): dirname = self._getDir(create) if (create) and (not os.path.isdir(dirname)): createPath(dirname, logging=0) return ('%s/product_names.xml') % (dirname) |
Clone # 396
Distance between two fragments = 2
Clone size = 7
Source file "./server/handlers/xmlrpc/registration.py" The first line is 1080 | Source file "./server/handlers/xmlrpc/registration.py" The first line is 1070 | |
def privacy_statement(self, lang=None): log_debug(1, ('lang: %s') % (lang)) if lang: cat.setlangs(lang) msg = _('Red Hat Network Privacy Statement') rhnFlags.set('compress_response', 1) return msg |
def welcome_message(self, lang=None): log_debug(1, ('lang: %s') % (lang)) if lang: cat.setlangs(lang) msg = _('Red Hat Network Welcome Message') rhnFlags.set('compress_response', 1) return msg |
Clone # 397
Distance between two fragments = 4
Clone size = 7
Source file "./server/rhnPackage.py" The first line is 162 | Source file "./server/rhnPackage.py" The first line is 89 | |
if row['path'] is None: log_error('Package path null for package id', row['id']) raise rhnFault(17, (_('Invalid RPM package %s requested')) % (str(pkg))) |
if max_row['path'] is None: log_error('Package path null for package id', max_row['id']) raise rhnFault(17, (_('Invalid RPM package %s requested')) % (pkg_spec)) |
|
filePath = ('%s/%s') % ((CFG.MOUNT_POINT, row['path'])) | filePath = ('%s/%s') % ((CFG.MOUNT_POINT, max_row['path'])) | |
if not os.access(filePath, os.R_OK): log_error('Package not found', filePath) raise rhnFault(17, _('Package not found')) |
if not os.access(filePath, os.R_OK): log_error('Package not found', filePath) raise rhnFault(17, _('Package not found')) |
Clone # 398
Distance between two fragments = 3
Clone size = 7
Source file "./server/repomd/repository.py" The first line is 87 | Source file "./server/repomd/repository.py" The first line is 75 | |
def get_other_xml_file(self): ret = self.get_other_cache() if not ret: viewobj = self.get_other_view() self.generate_files([viewobj]) ret = self.get_other_cache() return ret |
def get_primary_xml_file(self): ret = self.get_primary_cache() if not ret: viewobj = self.get_primary_view() self.generate_files([viewobj]) ret = self.get_primary_cache() return ret |
Clone # 399
Distance between two fragments = 3
Clone size = 7
Source file "./server/repomd/repository.py" The first line is 99 | Source file "./server/repomd/repository.py" The first line is 87 | |
def get_filelists_xml_file(self): ret = self.get_filelists_cache() if not ret: viewobj = self.get_filelists_view() self.generate_files([viewobj]) ret = self.get_filelists_cache() return ret |
def get_other_xml_file(self): ret = self.get_other_cache() if not ret: viewobj = self.get_other_view() self.generate_files([viewobj]) ret = self.get_other_cache() return ret |
Clone # 400
Distance between two fragments = 3
Clone size = 7
Source file "./server/repomd/repository.py" The first line is 99 | Source file "./server/repomd/repository.py" The first line is 75 | |
def get_filelists_xml_file(self): ret = self.get_filelists_cache() if not ret: viewobj = self.get_filelists_view() self.generate_files([viewobj]) ret = self.get_filelists_cache() return ret |
def get_primary_xml_file(self): ret = self.get_primary_cache() if not ret: viewobj = self.get_primary_view() self.generate_files([viewobj]) ret = self.get_primary_cache() return ret |
Clone # 401
Distance between two fragments = 4
Clone size = 7
Source file "./server/importlib/archImport.py" The first line is 119 | Source file "./server/importlib/archImport.py" The first line is 101 | |
arches1_lookup_method_name = 'lookupChannelArches' | arches1_lookup_method_name = 'lookupServerArches' | |
arches2_lookup_method_name = 'lookupPackageArches' | arches2_lookup_method_name = 'lookupPackageArches' | |
arches1_name = 'channel-arch' | arches1_name = 'server-arch' | |
arches2_name = 'package-arch' | arches2_name = 'package-arch' | |
arches1_field_name = 'channel_arch_id' | arches1_field_name = 'server_arch_id' | |
arches2_field_name = 'package_arch_id' | arches2_field_name = 'package_arch_id' | |
submit_method_name = 'processChannelPackageArchCompatMap' | submit_method_name = 'processServerPackageArchCompatMap' |
Clone # 402
Distance between two fragments = 4
Clone size = 7
Source file "./server/importlib/archImport.py" The first line is 110 | Source file "./server/importlib/archImport.py" The first line is 101 | |
arches1_lookup_method_name = 'lookupServerArches' | arches1_lookup_method_name = 'lookupServerArches' | |
arches2_lookup_method_name = 'lookupChannelArches' | arches2_lookup_method_name = 'lookupPackageArches' | |
arches1_name = 'server-arch' | arches1_name = 'server-arch' | |
arches2_name = 'channel-arch' | arches2_name = 'package-arch' | |
arches1_field_name = 'server_arch_id' | arches1_field_name = 'server_arch_id' | |
arches2_field_name = 'channel_arch_id' | arches2_field_name = 'package_arch_id' | |
submit_method_name = 'processServerChannelArchCompatMap' | submit_method_name = 'processServerPackageArchCompatMap' |
Clone # 403
Distance between two fragments = 4
Clone size = 7
Source file "./server/importlib/archImport.py" The first line is 110 | Source file "./server/importlib/archImport.py" The first line is 129 | |
arches1_lookup_method_name = 'lookupServerArches' | arches1_lookup_method_name = 'lookupServerArches' | |
arches2_lookup_method_name = 'lookupChannelArches' | arches2_lookup_method_name = 'lookupServerGroupTypes' | |
arches1_name = 'server-arch' | arches1_name = 'server-arch' | |
arches2_name = 'channel-arch' | arches2_name = 'server-group-type' | |
arches1_field_name = 'server_arch_id' | arches1_field_name = 'server_arch_id' | |
arches2_field_name = 'channel_arch_id' | arches2_field_name = 'server_group_type' | |
submit_method_name = 'processServerChannelArchCompatMap' | submit_method_name = 'processServerGroupServerArchCompatMap' |
Clone # 404
Distance between two fragments = 4
Clone size = 7
Source file "./server/importlib/archImport.py" The first line is 101 | Source file "./server/importlib/archImport.py" The first line is 129 | |
arches1_lookup_method_name = 'lookupServerArches' | arches1_lookup_method_name = 'lookupServerArches' | |
arches2_lookup_method_name = 'lookupPackageArches' | arches2_lookup_method_name = 'lookupServerGroupTypes' | |
arches1_name = 'server-arch' | arches1_name = 'server-arch' | |
arches2_name = 'package-arch' | arches2_name = 'server-group-type' | |
arches1_field_name = 'server_arch_id' | arches1_field_name = 'server_arch_id' | |
arches2_field_name = 'package_arch_id' | arches2_field_name = 'server_group_type' | |
submit_method_name = 'processServerPackageArchCompatMap' | submit_method_name = 'processServerGroupServerArchCompatMap' |
Clone # 405
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 418 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 384 | |
query = '\n\t\t select rktf.relative_filename "relative-path", \n\t\t c.checksum_type "checksum-type", c.checksum,\n rktf.file_size "file-size",\n\t\t TO_CHAR(rktf.last_modified, \'YYYYMMDDHH24MISS\') "last-modified", \n\t\t\t rkt.base_path "base-path",\n\t\t rkt.label label, \n\t\t\t TO_CHAR(rkt.modified, \'YYYYMMDDHH24MISS\') "modified"\n\t\t from rhnKSTreeFile rktf, rhnKickstartableTree rkt,\n rhnChecksumView c\n\t\t where rktf.kstree_id = :kstree_id\n\t\t and rkt.id = rktf.kstree_id\n and rktf.checksum_id = c.id\n\t ' | query = "\n\t select kt.id kstree_id, kt.label kickstart_label, \n\t\t TO_CHAR(kt.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnKickstartableTree kt\n\t\t where kt.channel_id = :channel_id\n\t\t " | |
if self.start_date: query += "\n\t\t and rkt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t and rkt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n " |
if self.start_date: query += "\n\t\t and (kt.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t or kt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and (kt.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and kt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and kt.org_id is Null\n " |
|
self.kickstart_files_query = rhnSQL.Statement(query) | self.kickstart_trees_query = rhnSQL.Statement(query) | |
kickstart_files = rhnSQL.prepare(self.kickstart_files_query) | kickstart_data = rhnSQL.prepare(self.kickstart_trees_query) |
Clone # 406
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 418 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 347 | |
query = '\n\t\t select rktf.relative_filename "relative-path", \n\t\t c.checksum_type "checksum-type", c.checksum,\n rktf.file_size "file-size",\n\t\t TO_CHAR(rktf.last_modified, \'YYYYMMDDHH24MISS\') "last-modified", \n\t\t\t rkt.base_path "base-path",\n\t\t rkt.label label, \n\t\t\t TO_CHAR(rkt.modified, \'YYYYMMDDHH24MISS\') "modified"\n\t\t from rhnKSTreeFile rktf, rhnKickstartableTree rkt,\n rhnChecksumView c\n\t\t where rktf.kstree_id = :kstree_id\n\t\t and rkt.id = rktf.kstree_id\n and rktf.checksum_id = c.id\n\t ' | query = '\n select e.id errata_id,\n\t\t TO_CHAR(e.last_modified,\'YYYYMMDDHH24MISS\') last_modified,\n\t\t e.advisory_name "advisory-name"\n\t from rhnChannelErrata ce, rhnErrata e\n\t\t where ce.channel_id = :channel_id\n\t\t and ce.errata_id = e.id\n\t\t' | |
if self.start_date: query += "\n\t\t and rkt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t and rkt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n " |
if self.start_date: query += "\n and (ce.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or e.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n and (ce.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and e.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.kickstart_files_query = rhnSQL.Statement(query) | self.errata_query = rhnSQL.Statement(query) | |
kickstart_files = rhnSQL.prepare(self.kickstart_files_query) | errata_data = rhnSQL.prepare(self.errata_query) |
Clone # 407
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 418 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 273 | |
query = '\n\t\t select rktf.relative_filename "relative-path", \n\t\t c.checksum_type "checksum-type", c.checksum,\n rktf.file_size "file-size",\n\t\t TO_CHAR(rktf.last_modified, \'YYYYMMDDHH24MISS\') "last-modified", \n\t\t\t rkt.base_path "base-path",\n\t\t rkt.label label, \n\t\t\t TO_CHAR(rkt.modified, \'YYYYMMDDHH24MISS\') "modified"\n\t\t from rhnKSTreeFile rktf, rhnKickstartableTree rkt,\n rhnChecksumView c\n\t\t where rktf.kstree_id = :kstree_id\n\t\t and rkt.id = rktf.kstree_id\n and rktf.checksum_id = c.id\n\t ' | query = "\n select rp.id package_id, \n\t\t TO_CHAR(rp.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnPackage rp, rhnChannelPackage rcp\n\t\t where rcp.channel_id = :channel_id\n\t\t and rcp.package_id = rp.id\n\t\t" | |
if self.start_date: query += "\n\t\t and rkt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t and rkt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.kickstart_files_query = rhnSQL.Statement(query) | self.package_query = rhnSQL.Statement(query) | |
kickstart_files = rhnSQL.prepare(self.kickstart_files_query) | package_data = rhnSQL.prepare(self.package_query) |
Clone # 408
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 384 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 347 | |
query = "\n\t select kt.id kstree_id, kt.label kickstart_label, \n\t\t TO_CHAR(kt.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnKickstartableTree kt\n\t\t where kt.channel_id = :channel_id\n\t\t " | query = '\n select e.id errata_id,\n\t\t TO_CHAR(e.last_modified,\'YYYYMMDDHH24MISS\') last_modified,\n\t\t e.advisory_name "advisory-name"\n\t from rhnChannelErrata ce, rhnErrata e\n\t\t where ce.channel_id = :channel_id\n\t\t and ce.errata_id = e.id\n\t\t' | |
if self.start_date: query += "\n\t\t and (kt.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t or kt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and (kt.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and kt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and kt.org_id is Null\n " |
if self.start_date: query += "\n and (ce.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or e.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n and (ce.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and e.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.kickstart_trees_query = rhnSQL.Statement(query) | self.errata_query = rhnSQL.Statement(query) | |
kickstart_data = rhnSQL.prepare(self.kickstart_trees_query) | errata_data = rhnSQL.prepare(self.errata_query) |
Clone # 409
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 402 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 369 | |
self.kickstart_trees = [] | self.errata_info = [] | |
log2stdout(1, 'Gathering kickstart data...') | log2stdout(1, 'Gathering errata info...') | |
for channel_id in self.channel_ids: kickstart_data.execute(channel_id=channel_id['channel_id'], **dates) a_tree = (kickstart_data.fetchall_dict()) or ([]) if a_tree: self.kickstart_trees = (self.kickstart_trees) + (a_tree) |
for channel_id in self.channel_ids: errata_data.execute(channel_id=channel_id['channel_id'], **dates) an_errata = (errata_data.fetchall_dict()) or ([]) if an_errata: self.errata_info = (self.errata_info) + (an_errata) |
Clone # 410
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 384 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 273 | |
query = "\n\t select kt.id kstree_id, kt.label kickstart_label, \n\t\t TO_CHAR(kt.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnKickstartableTree kt\n\t\t where kt.channel_id = :channel_id\n\t\t " | query = "\n select rp.id package_id, \n\t\t TO_CHAR(rp.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnPackage rp, rhnChannelPackage rcp\n\t\t where rcp.channel_id = :channel_id\n\t\t and rcp.package_id = rp.id\n\t\t" | |
if self.start_date: query += "\n\t\t and (kt.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t or kt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and (kt.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and kt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and kt.org_id is Null\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.kickstart_trees_query = rhnSQL.Statement(query) | self.package_query = rhnSQL.Statement(query) | |
kickstart_data = rhnSQL.prepare(self.kickstart_trees_query) | package_data = rhnSQL.prepare(self.package_query) |
Clone # 411
Distance between two fragments = 4
Clone size = 8
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 402 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 294 | |
self.kickstart_trees = [] | self.pkg_info = [] | |
log2stdout(1, 'Gathering kickstart data...') | log2stdout(1, 'Gathering package info...') | |
for channel_id in self.channel_ids: kickstart_data.execute(channel_id=channel_id['channel_id'], **dates) a_tree = (kickstart_data.fetchall_dict()) or ([]) if a_tree: self.kickstart_trees = (self.kickstart_trees) + (a_tree) |
for channel_id in self.channel_ids: package_data.execute(channel_id=channel_id['channel_id'], **dates) a_package = (package_data.fetchall_dict()) or ([]) if a_package: self.pkg_info = (self.pkg_info) + (a_package) |
Clone # 412
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 347 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 273 | |
query = '\n select e.id errata_id,\n\t\t TO_CHAR(e.last_modified,\'YYYYMMDDHH24MISS\') last_modified,\n\t\t e.advisory_name "advisory-name"\n\t from rhnChannelErrata ce, rhnErrata e\n\t\t where ce.channel_id = :channel_id\n\t\t and ce.errata_id = e.id\n\t\t' | query = "\n select rp.id package_id, \n\t\t TO_CHAR(rp.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnPackage rp, rhnChannelPackage rcp\n\t\t where rcp.channel_id = :channel_id\n\t\t and rcp.package_id = rp.id\n\t\t" | |
if self.start_date: query += "\n and (ce.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or e.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n and (ce.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and e.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.errata_query = rhnSQL.Statement(query) | self.package_query = rhnSQL.Statement(query) | |
errata_data = rhnSQL.prepare(self.errata_query) | package_data = rhnSQL.prepare(self.package_query) |
Clone # 413
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 369 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 294 | |
self.errata_info = [] | self.pkg_info = [] | |
log2stdout(1, 'Gathering errata info...') | log2stdout(1, 'Gathering package info...') | |
for channel_id in self.channel_ids: errata_data.execute(channel_id=channel_id['channel_id'], **dates) an_errata = (errata_data.fetchall_dict()) or ([]) if an_errata: self.errata_info = (self.errata_info) + (an_errata) |
for channel_id in self.channel_ids: package_data.execute(channel_id=channel_id['channel_id'], **dates) a_package = (package_data.fetchall_dict()) or ([]) if a_package: self.pkg_info = (self.pkg_info) + (a_package) |
Clone # 414
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 418 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 239 | |
query = '\n\t\t select rktf.relative_filename "relative-path", \n\t\t c.checksum_type "checksum-type", c.checksum,\n rktf.file_size "file-size",\n\t\t TO_CHAR(rktf.last_modified, \'YYYYMMDDHH24MISS\') "last-modified", \n\t\t\t rkt.base_path "base-path",\n\t\t rkt.label label, \n\t\t\t TO_CHAR(rkt.modified, \'YYYYMMDDHH24MISS\') "modified"\n\t\t from rhnKSTreeFile rktf, rhnKickstartableTree rkt,\n rhnChecksumView c\n\t\t where rktf.kstree_id = :kstree_id\n\t\t and rkt.id = rktf.kstree_id\n and rktf.checksum_id = c.id\n\t ' | query = '\n select rcp.package_id id, rp.path path\n\t\t from rhnChannelPackage rcp, rhnPackage rp\n\t\t where rcp.package_id = rp.id\n\t\t and rcp.channel_id = :channel_id\n ' | |
if self.start_date: query += "\n\t\t and rkt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t and rkt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.kickstart_files_query = rhnSQL.Statement(query) | self.brpm_query = rhnSQL.Statement(query) | |
kickstart_files = rhnSQL.prepare(self.kickstart_files_query) | brpm_data = rhnSQL.prepare(self.brpm_query) |
Clone # 415
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 384 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 239 | |
query = "\n\t select kt.id kstree_id, kt.label kickstart_label, \n\t\t TO_CHAR(kt.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnKickstartableTree kt\n\t\t where kt.channel_id = :channel_id\n\t\t " | query = '\n select rcp.package_id id, rp.path path\n\t\t from rhnChannelPackage rcp, rhnPackage rp\n\t\t where rcp.package_id = rp.id\n\t\t and rcp.channel_id = :channel_id\n ' | |
if self.start_date: query += "\n\t\t and (kt.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n\t\t or kt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and (kt.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and kt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n\t\t and kt.org_id is Null\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.kickstart_trees_query = rhnSQL.Statement(query) | self.brpm_query = rhnSQL.Statement(query) | |
kickstart_data = rhnSQL.prepare(self.kickstart_trees_query) | brpm_data = rhnSQL.prepare(self.brpm_query) |
Clone # 416
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 347 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 239 | |
query = '\n select e.id errata_id,\n\t\t TO_CHAR(e.last_modified,\'YYYYMMDDHH24MISS\') last_modified,\n\t\t e.advisory_name "advisory-name"\n\t from rhnChannelErrata ce, rhnErrata e\n\t\t where ce.channel_id = :channel_id\n\t\t and ce.errata_id = e.id\n\t\t' | query = '\n select rcp.package_id id, rp.path path\n\t\t from rhnChannelPackage rcp, rhnPackage rp\n\t\t where rcp.package_id = rp.id\n\t\t and rcp.channel_id = :channel_id\n ' | |
if self.start_date: query += "\n and (ce.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or e.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n )\n and (ce.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and e.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.errata_query = rhnSQL.Statement(query) | self.brpm_query = rhnSQL.Statement(query) | |
errata_data = rhnSQL.prepare(self.errata_query) | brpm_data = rhnSQL.prepare(self.brpm_query) |
Clone # 417
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 273 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 239 | |
query = "\n select rp.id package_id, \n\t\t TO_CHAR(rp.last_modified, 'YYYYMMDDHH24MISS') last_modified\n\t\t from rhnPackage rp, rhnChannelPackage rcp\n\t\t where rcp.channel_id = :channel_id\n\t\t and rcp.package_id = rp.id\n\t\t" | query = '\n select rcp.package_id id, rp.path path\n\t\t from rhnChannelPackage rcp, rhnPackage rp\n\t\t where rcp.package_id = rp.id\n\t\t and rcp.channel_id = :channel_id\n ' | |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
if self.start_date: query += "\n and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')\n or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS') \n )\n and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')\n )\n " |
|
self.package_query = rhnSQL.Statement(query) | self.brpm_query = rhnSQL.Statement(query) | |
package_data = rhnSQL.prepare(self.package_query) | brpm_data = rhnSQL.prepare(self.brpm_query) |
Clone # 418
Distance between two fragments = 4
Clone size = 7
Source file "./satellite_tools/disk_dumper/iss.py" The first line is 314 | Source file "./satellite_tools/disk_dumper/iss.py" The first line is 418 | |
query = "\n select ps.id package_id, \n\t\t TO_CHAR(ps.last_modified,'YYYYMMDDHH24MISS') last_modified, ps.source_rpm_id source_rpm_id\n from rhnPackageSource ps\n\t\t" | query = '\n\t\t select rktf.relative_filename "relative-path", \n\t\t c.checksum_type "checksum-type", c.checksum,\n rktf.file_size "file-size",\n\t\t TO_CHAR(rktf.last_modified, \'YYYYMMDDHH24MISS\') "last-modified", \n\t\t\t rkt.base_path "base-path",\n\t\t rkt.label label, \n\t\t\t TO_CHAR(rkt.modified, \'YYYYMMDDHH24MISS\') "modified"\ |