diff --git a/osc/commandline.py b/osc/commandline.py index 5bd5a7b3..c7b1c264 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -93,8 +93,6 @@ class Osc(cmdln.Cmdln): help='specify alternate configuration file') optparser.add_argument('--no-keyring', action='store_true', help='disable usage of desktop keyring system') - optparser.add_argument('--no-gnome-keyring', action='store_true', - help='disable usage of GNOME Keyring') verbose_group = optparser.add_mutually_exclusive_group() verbose_group.add_argument('-v', '--verbose', action='store_true', help='increase verbosity') @@ -121,7 +119,6 @@ class Osc(cmdln.Cmdln): override_traceback = self.options.traceback, override_post_mortem = self.options.post_mortem, override_no_keyring = self.options.no_keyring, - override_no_gnome_keyring = self.options.no_gnome_keyring, override_verbose = self.options.verbose) except oscerr.NoConfigfile as e: print(e.msg, file=sys.stderr) @@ -646,7 +643,6 @@ class Osc(cmdln.Cmdln): @cmdln.alias('bsdevelproject') @cmdln.alias('dp') - @cmdln.option('-r', '--raw', action='store_true', help='deprecated option') def do_develproject(self, subcmd, opts, *args): """ Print the devel project / package of a package @@ -1170,8 +1166,6 @@ class Osc(cmdln.Cmdln): '(primary project where a package is developed)') @cmdln.option('--separate-requests', action='store_true', help='Create multiple requests instead of a single one (when command is used for entire project)') - @cmdln.option('--seperate-requests', action='store_true', - help='Deprecated (wrong spelling - see --separate-requests)') @cmdln.option('--cleanup', action='store_true', help='remove package if submission gets accepted (default for home::branch projects)') @cmdln.option('--no-cleanup', action='store_true', @@ -1220,10 +1214,6 @@ class Osc(cmdln.Cmdln): if opts.cleanup and opts.no_cleanup: raise oscerr.WrongOptions('\'--cleanup\' and \'--no-cleanup\' are mutually exclusive') - if opts.seperate_requests: - # compatibility option will be removed in the future - print('--seperate-requests is deprecated (use ' - '--separate-requests)', file=sys.stderr) src_update = conf.config['submitrequest_on_accept_action'] or None # we should check here for home::branch and default to update, but that would require OBS 1.7 server @@ -1255,20 +1245,6 @@ class Osc(cmdln.Cmdln): args = slash_split(args) - # remove this block later again - oldcmds = ['create', 'list', 'log', 'show', 'decline', 'accept', 'delete', 'revoke'] - if args and args[0] in oldcmds: - print("************************************************************************", file=sys.stderr) - print("* WARNING: It looks that you are using this command with a *", file=sys.stderr) - print("* deprecated syntax. *", file=sys.stderr) - print("* Please run \"osc sr --help\" and \"osc rq --help\" *", file=sys.stderr) - print("* to see the new syntax. *", file=sys.stderr) - print("************************************************************************", file=sys.stderr) - if args[0] == 'create': - args.pop(0) - else: - sys.exit(1) - if len(args) > 4: raise oscerr.WrongArgs('Too many arguments.') @@ -1287,7 +1263,7 @@ class Osc(cmdln.Cmdln): target_project = None if len(args) == 1: target_project = self._process_project_name(args[0]) - if opts.separate_requests or opts.seperate_requests: + if opts.separate_requests: for p in meta_get_packagelist(apiurl, project): # get _link info from server, that knows about the local state ... u = makeurl(apiurl, ['source', project, p]) @@ -2695,26 +2671,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. change_request_state(apiurl, req.reqid, 'superseded', 'superseded by %s' % rid, rid) - # editmeta and its aliases are all deprecated - @cmdln.alias("editprj") - @cmdln.alias("createprj") - @cmdln.alias("editpac") - @cmdln.alias("createpac") - @cmdln.alias("edituser") - @cmdln.alias("usermeta") - @cmdln.hide() - def do_editmeta(self, subcmd, opts, *args): - """ - Obsolete command to edit metadata. Use 'meta' now - - See the help output of 'meta'. - """ - - print("This command is obsolete. Use 'osc meta ...'.", file=sys.stderr) - print("See 'osc help meta'.", file=sys.stderr) - return 2 - - @cmdln.option('-r', '--revision', metavar='rev', help='use the specified revision.') @cmdln.option('-R', '--use-plain-revision', action='store_true', @@ -3828,37 +3784,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. else: unlock_project(apiurl, prj, msg) - @cmdln.hide() - def do_deletepac(self, subcmd, opts, *args): - """ - Obsolete command to delete package. Use 'delete' or 'rdelete' now - - See the help output of 'delete' and 'rdelete'. - """ - - print("""Command deletepac is obsolete ! - - Please use either - osc delete for checked out packages or projects - or - osc rdelete for server side operations.""", file=sys.stderr) - - return 2 - - @cmdln.hide() - @cmdln.option('-f', '--force', action='store_true', - help='deletes a project and its packages') - def do_deleteprj(self, subcmd, opts, project): - """ - Obsolete command to delete project. Use 'rdelete' now. - - See the help output of 'rdelete'. - """ - - print("This command is obsolete. Use 'osc rdelete '.", file=sys.stderr) - print("See 'osc help rdelete'.", file=sys.stderr) - return 2 - @cmdln.alias('metafromspec') @cmdln.alias('updatepkgmetafromspec') @cmdln.option('', '--specfile', metavar='FILE', @@ -3980,12 +3905,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. run_pager(diff) - @cmdln.option('--oldprj', metavar='OLDPRJ', - help='project to compare against' - ' (deprecated, use 3 argument form)') - @cmdln.option('--oldpkg', metavar='OLDPKG', - help='package to compare against' - ' (deprecated, use 3 argument form)') @cmdln.option('--issues-only', action='store_true', help='show only issues in diff') @cmdln.option('-M', '--meta', action='store_true', @@ -4032,13 +3951,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. if len(args) == 2: new_project = self._process_project_name(args[0]) new_package = args[1] - if opts.oldprj: - old_project = opts.oldprj - if opts.oldpkg: - old_package = opts.oldpkg elif len(args) == 3 or len(args) == 4: - if opts.oldprj or opts.oldpkg: - raise oscerr.WrongArgs('--oldpkg and --oldprj are only valid with two arguments') old_project = self._process_project_name(args[0]) new_package = old_package = args[1] new_project = self._process_project_name(args[2]) @@ -4850,8 +4763,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='read log message from FILE, \'-\' denotes standard input.') @cmdln.option('-f', '--force', default=False, action="store_true", help='force commit, even if there were no changes') - @cmdln.option('--skip-validation', default=False, action="store_true", - help='deprecated, don\'t use it') @cmdln.option('--skip-local-service-run', '--noservice', default=False, action="store_true", help='Skip service run of configured source services for local run') def do_commit(self, subcmd, opts, *args): @@ -4884,8 +4795,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. def _commit(self, subcmd, opts, args): args = parseargs(args) - if opts.skip_validation: - print("WARNING: deprecated option --skip-validation ignored.", file=sys.stderr) msg = '' if opts.message: @@ -5273,41 +5182,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. rows.append([dist[h] for h in headers]) print(format_table(rows, headers).rstrip()) - - @cmdln.hide() - def do_results_meta(self, subcmd, opts, *args): - """ - Obsolete command to show build results. Use 'results --xml' now. - - See the help output of 'results'. - """ - - print("This command is obsolete. Use 'osc results --xml'.", - file=sys.stderr) - print("See 'osc help results'.", file=sys.stderr) - return 2 - - @cmdln.hide() - @cmdln.option('-l', '--last-build', action='store_true', - help='show last build results (succeeded/failed/unknown)') - @cmdln.option('-r', '--repo', action='append', default = [], - help='Show results only for specified repo(s)') - @cmdln.option('-a', '--arch', action='append', default = [], - help='Show results only for specified architecture(s)') - @cmdln.option('', '--xml', action='store_true', - help='generate output in XML (former results_meta)') - def do_rresults(self, subcmd, opts, *args): - """ - Obsolete command to show build results. Use 'results' now - - See the help output of 'results'. - """ - - print("Command rresults is obsolete. Running 'osc results' instead", - file=sys.stderr) - print("See 'osc help results'.", file=sys.stderr) - return self.do_results('results', opts, *args) - @cmdln.option('-f', '--force', action='store_true', default=False, help="Don't ask and delete files") def do_rremove(self, subcmd, opts, project, package, *files): @@ -5510,27 +5384,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. arch=opts.arch, vertical=opts.vertical, \ show_excluded=opts.show_excluded, brief=opts.brief))) - @cmdln.option('-q', '--hide-legend', action='store_true', - help='hide the legend') - @cmdln.option('-c', '--csv', action='store_true', - help='csv output') - @cmdln.option('-s', '--status-filter', metavar='STATUS', - help='show only packages with buildstatus STATUS (see legend)') - @cmdln.option('-n', '--name-filter', metavar='EXPR', - help='show only packages whose names match EXPR') - @cmdln.hide() - def do_rprjresults(self, subcmd, opts, *args): - """ - Obsolete command to show project-wide build results. Use 'prjresults' now. - - See the help output of 'prjresults'. - """ - - print("Command rprjresults is obsolete. Please use 'osc prjresults'", - file=sys.stderr) - print("See 'osc help prjresults'.", file=sys.stderr) - return 2 - @cmdln.alias('rpmlint') @cmdln.alias('lint') def do_rpmlintlog(self, subcmd, opts, *args): @@ -6925,19 +6778,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. print_jobhistory(apiurl, project, package, repository, arch, format, opts.limit) - @cmdln.hide() - def do_rlog(self, subcmd, opts, *args): - """ - Obsolete command to show commit logs. Use 'log' now - - See the help output of 'log'. - """ - - print("This command is obsolete. Use 'osc log'.", file=sys.stderr) - print("See 'osc help log'.", file=sys.stderr) - return 2 - - @cmdln.option('-r', '--revision', metavar='rev', help='show log of the specified revision') @cmdln.option('', '--csv', action='store_true', @@ -7758,8 +7598,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='as -i, but only bugowner') @cmdln.option('-m', '--maintainer', action='store_true', help='as -i, but only maintainer') - @cmdln.option('--maintained', action='store_true', - help='OBSOLETE: please use maintained command instead.') @cmdln.option('-M', '--mine', action='store_true', help='shorthand for --bugowner --package') @cmdln.option('--csv', action='store_true', @@ -7802,9 +7640,6 @@ Please submit there instead, or use --nodevelproject to force direct submission. else: search_term = args[0] - if opts.maintained: - raise oscerr.WrongOptions('The --maintained option is not anymore supported. Please use the maintained command instead.') - # XXX: is it a good idea to make this the default? # support perl symbols: if re.match(r'^perl\(\w+(::\w+)*\)$', search_term): diff --git a/osc/conf.py b/osc/conf.py index f7a7a126..32e06d30 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -52,19 +52,12 @@ from .util.helper import raw_input GENERIC_KEYRING = False -GNOME_KEYRING = False try: import keyring GENERIC_KEYRING = True except: - try: - import gobject - gobject.set_application_name('osc') - import gnomekeyring - GNOME_KEYRING = gnomekeyring.is_available() - except: - pass + pass def _get_processors(): @@ -133,7 +126,6 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org', 'traceback': '0', 'post_mortem': '0', 'use_keyring': '0', - 'gnome_keyring': '0', 'cookiejar': _identify_osccookiejar(), # fallback for osc build option --no-verify 'no_verify': '0', @@ -153,8 +145,6 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org', 'checkout_rooted': '0', # local files to ignore with status, addremove, .... 'exclude_glob': '.osc CVS .svn .* _linkerror *~ #*# *.orig *.bak *.changes.vctmp.*', - # whether to keep passwords in plaintext (deprecated (see creds manager)). - 'plaintext_passwd': '0', # whether to print Web UI links to directly insert in browser (where possible) 'print_web_links': '0', # limit the age of requests shown with 'osc req list'. @@ -196,9 +186,9 @@ if not os.path.isfile('/usr/bin/build') and os.path.isfile('/usr/bin/obs-build') if not os.path.isfile('/usr/lib/build/vc') and os.path.isfile('/usr/lib/obs-build/vc'): DEFAULTS['vc-cmd'] = '/usr/lib/obs-build/vc' -boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd', +boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive', - 'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check', + 'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'no_verify', 'builtin_signature_check', 'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time', 'no_preinstallimage', 'status_mtime_heuristic', 'print_web_links', 'ccache', 'sccache', 'build-shell-after-fail'] integer_opts = ['build-jobs'] @@ -635,9 +625,10 @@ def config_set_option(section, opt, val=None, delete=False, update=True, creds_m write_config(config['conffile'], cp) run = True if run and update: - kw = {'override_conffile': config['conffile'], - 'override_no_keyring': config['use_keyring'], - 'override_no_gnome_keyring': config['gnome_keyring']} + kw = { + 'override_conffile': config['conffile'], + 'override_no_keyring': config['use_keyring'], + } kw.update(kwargs) get_config(**kw) if cp.has_option(section, opt): @@ -707,9 +698,6 @@ def _get_credentials_manager(url, cp): return creds_mgr if config['use_keyring'] and GENERIC_KEYRING: return credentials.get_keyring_credentials_manager(cp) - elif config['gnome_keyring'] and GNOME_KEYRING: - protocol, host, path = parse_apisrv_url(None, url) - return credentials.GnomeKeyringCredentialsManager(cp, None) elif cp.get(url, 'passx') is not None: return credentials.ObfuscatedConfigFileCredentialsManager(cp, None) return credentials.PlaintextConfigFileCredentialsManager(cp, None) @@ -733,7 +721,6 @@ def get_config(override_conffile=None, override_traceback=None, override_post_mortem=None, override_no_keyring=None, - override_no_gnome_keyring=None, override_verbose=None): """do the actual work (see module documentation)""" global config @@ -794,8 +781,6 @@ def get_config(override_conffile=None, # This needs to be done before processing API sections as it might be already used there if override_no_keyring: config['use_keyring'] = False - if override_no_gnome_keyring: - config['gnome_keyring'] = False aliases = {} for url in [x for x in cp.sections() if x != 'general']: @@ -885,8 +870,6 @@ def get_config(override_conffile=None, if 'build_platform' in config: print('Warning: Use of \'build_platform\' config option is deprecated! (use \'build_repository\' instead)', file=sys.stderr) config['build_repository'] = config['build_platform'] - if config['plaintext_passwd']: - print('The \'plaintext_passwd\' option is deprecated and will be ignored', file=sys.stderr) config['verbose'] = bool(int(config['verbose'])) # override values which we were called with diff --git a/osc/core.py b/osc/core.py index c1ade627..abbd788e 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2849,13 +2849,6 @@ class Request: return self.actions return [i for i in self.actions if i.type in types] - def get_creator(self): - """Return the creator of the request. - - This method is deprecated (use "creator" attribute instead"). - """ - return self.creator - def to_xml(self): """:return: object serialized to XML""" root = ET.Element('request') diff --git a/osc/credentials.py b/osc/credentials.py index 3b5826a2..47fc9886 100644 --- a/osc/credentials.py +++ b/osc/credentials.py @@ -15,16 +15,6 @@ except BaseException as e: print(msg, e, file=sys.stderr) keyring = None -try: - import gnomekeyring -except ImportError: - gnomekeyring = None -except BaseException as e: - # catch and report any exceptions raised in the 'gnomekeyring' module - msg = "Warning: Unable to load the 'gnomekeyring' module due to an internal error:" - print(msg, e, file=sys.stderr) - gnomekeyring = None - from . import conf from . import oscerr @@ -283,77 +273,6 @@ class KeyringCredentialsDescriptor(AbstractCredentialsManagerDescriptor): return KeyringCredentialsManager(cp, qualified_backend_name) -class GnomeKeyringCredentialsManager(AbstractCredentialsManager): - @classmethod - def create(cls, cp, options): - if gnomekeyring is None: - return None - return super(cls, cls).create(cp, options) - - def _get_password(self, url, user): - gk_data = self._keyring_data(url, user) - if gk_data is None: - return None - return gk_data['password'] - - def set_password(self, url, user, password): - scheme, host, path = self._urlsplit(url) - gnomekeyring.set_network_password_sync( - user=user, - password=password, - protocol=scheme, - server=host, - object=path) - self._cp.set(url, self.config_entry, self._qualified_name()) - - def delete_password(self, url, user): - gk_data = self._keyring_data(url, user) - if gk_data is None: - return - gnomekeyring.item_delete_sync(gk_data['keyring'], gk_data['item_id']) - - def get_user(self, url): - gk_data = self._keyring_data(url, None) - if gk_data is None: - return None - return gk_data['user'] - - def _keyring_data(self, url, user): - scheme, host, path = self._urlsplit(url) - try: - entries = gnomekeyring.find_network_password_sync(protocol=scheme, - server=host, - object=path) - except gnomekeyring.NoMatchError: - return None - - for entry in entries: - if 'user' not in entry or 'password' not in entry: - continue - if user is None or entry['user'] == user: - return entry - return None - - def _urlsplit(self, url): - splitted_url = urlsplit(url) - return splitted_url.scheme, splitted_url.netloc, splitted_url.path - - -class GnomeKeyringCredentialsDescriptor(AbstractCredentialsManagerDescriptor): - def name(self): - return 'GNOME Keyring Manager (deprecated)' - - def description(self): - return 'Deprecated GNOME Keyring Manager. If you use \ - this we will send you a Dial-In modem' - - def priority(self): - return 0 - - def create(self, cp): - return GnomeKeyringCredentialsManager(cp, None) - - # we're supporting only selected python-keyring backends in osc SUPPORTED_KEYRING_BACKENDS = { "keyutils.osc.OscKernelKeyringBackend": { @@ -390,8 +309,6 @@ def get_credentials_manager_descriptors(): data["priority"] ) descriptors.append(descriptor) - if gnomekeyring: - descriptors.append(GnomeKeyringCredentialsDescriptor()) descriptors.append(PlaintextConfigFileDescriptor()) descriptors.append(ObfuscatedConfigFileDescriptor()) descriptors.append(TransientDescriptor()) diff --git a/tests/common.py b/tests/common.py index 0e6766b8..db0f4ee2 100644 --- a/tests/common.py +++ b/tests/common.py @@ -202,8 +202,7 @@ class OscTestCase(unittest.TestCase): EXPECTED_REQUESTS = [] os.chdir(os.path.dirname(__file__)) oscrc = os.path.join(self._get_fixtures_dir(), 'oscrc') - osc.conf.get_config(override_conffile=oscrc, - override_no_keyring=True, override_no_gnome_keyring=True) + osc.conf.get_config(override_conffile=oscrc, override_no_keyring=True) os.environ['OSC_CONFIG'] = oscrc self.tmpdir = tempfile.mkdtemp(prefix='osc_test') diff --git a/tests/test_prdiff.py b/tests/test_prdiff.py index 7cbe7c49..585a794c 100644 --- a/tests/test_prdiff.py +++ b/tests/test_prdiff.py @@ -56,7 +56,7 @@ class TestProjectDiff(OscTestCase): def _run_prdiff(self, *args): """Runs osc prdiff, returning captured STDOUT as a string.""" cli = osc.commandline.Osc() - argv = ['osc', '--no-keyring', '--no-gnome-keyring', 'prdiff'] + argv = ['osc', '--no-keyring', 'prdiff'] argv.extend(args) cli.main(argv=argv) return sys.stdout.getvalue() diff --git a/tests/test_results.py b/tests/test_results.py index 7269c7e7..384eae2b 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -23,7 +23,7 @@ class TestResults(OscTestCase): def _run_osc(self, *args): """Runs osc, returning captured STDOUT as a string.""" cli = osc.commandline.Osc() - argv = ['osc', '--no-keyring', '--no-gnome-keyring'] + argv = ['osc', '--no-keyring'] argv.extend(args) cli.main(argv=argv) return sys.stdout.getvalue()