From 2fe9cfd63b87ca1677bd759cd951fbd4390795bc Mon Sep 17 00:00:00 2001 From: Robert Cerven Date: Feb 02 2018 12:53:13 +0000 Subject: cleanup_flatpak Signed-off-by: Robert Cerven --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 74cdbfc..7677ebf 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -620,8 +620,7 @@ class Commands(object): self._module_name = self._module_name_spec return - raise rpkgError('Could not find current module name.' - ' Use --module-name.') + raise rpkgError('Could not find current module name.') @property def ns(self): diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index 279a7c7..7319dbf 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -161,15 +161,6 @@ class cliClient(object): lookaside_namespaced=la_namespaced ) - if self.args.module_name: - # Module name was specified via argument - if '/' not in self.args.module_name: - self._cmd.module_name = self.args.module_name - if dg_namespaced: - # No slash, assume rpms namespace - self._cmd.ns = 'rpms' - else: - self._cmd.ns, self._cmd.module_name = self.args.module_name.rsplit('/', 1) self._cmd.password = self.args.password self._cmd.runas = self.args.runas self._cmd.debug = self.args.debug @@ -225,14 +216,6 @@ class cliClient(object): help='Deprecated. Use --release instead. You can use --dist ' 'for a while for backward-compatibility. It will be disabled' ' in future version.') - # Allow forcing the package name - self.parser.add_argument('--module-name', - help=('Override the module name. Otherwise' - ' it is discovered from: Git push URL' - ' or Git URL (last part of path with' - ' .git extension removed) or from name' - ' macro in spec file. In that order.') - ) # Override the discovered user name self.parser.add_argument('--user', default=None, help='Override the discovered user name') diff --git a/tests/test_cli.py b/tests/test_cli.py index fb95e5c..d9812bc 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -86,48 +86,6 @@ class CliTestCase(CommandTestCase): stdout=subprocess.PIPE, stderr=subprocess.PIPE) -class TestModuleNameOption(CliTestCase): - - def get_cmd(self, module_name, cfg=None): - cmd = ['rpkg', '--path', self.cloned_repo_path, '--module-name', module_name, 'verrel'] - with patch('sys.argv', new=cmd): - cli = self.new_cli(cfg=cfg) - return cli.cmd - - def test_non_namespaced(self): - cmd = self.get_cmd('foo') - self.assertEqual(cmd._module_name, 'foo') - self.assertEqual(cmd.ns_module_name, 'foo') - - def test_just_module_name(self): - cmd = self.get_cmd( - 'foo', - os.path.join(os.path.dirname(__file__), 'fixtures', 'rpkg-ns.conf')) - self.assertEqual(cmd._module_name, 'foo') - self.assertEqual(cmd.ns_module_name, 'rpms/foo') - - def test_explicit_default(self): - cmd = self.get_cmd( - 'rpms/foo', - os.path.join(os.path.dirname(__file__), 'fixtures', 'rpkg-ns.conf')) - self.assertEqual(cmd._module_name, 'foo') - self.assertEqual(cmd.ns_module_name, 'rpms/foo') - - def test_with_namespace(self): - cmd = self.get_cmd( - 'container/foo', - os.path.join(os.path.dirname(__file__), 'fixtures', 'rpkg-ns.conf')) - self.assertEqual(cmd._module_name, 'foo') - self.assertEqual(cmd.ns_module_name, 'container/foo') - - def test_with_nested_namespace(self): - cmd = self.get_cmd( - 'user/project/foo', - os.path.join(os.path.dirname(__file__), 'fixtures', 'rpkg-ns.conf')) - self.assertEqual(cmd._module_name, 'foo') - self.assertEqual(cmd.ns_module_name, 'user/project/foo') - - class TestKojiConfigBackwardCompatibility(CliTestCase): """Test backward compatibility of kojiconfig and kojiprofile @@ -250,7 +208,6 @@ class TestContainerBuildWithKoji(CliTestCase): This test can be delete after kojiconfig is removed eventually. """ cli_cmd = ['rpkg', '--path', self.cloned_repo_path, - '--module-name', 'mycontainer', 'container-build'] cfg_file = os.path.join(os.path.dirname(__file__), @@ -867,7 +824,7 @@ class TestLint(CliTestCase): def test_lint(self, _run_command): self.checkout_branch(git.Repo(self.cloned_repo_path), 'eng-rhel-7') - cli_cmd = ['rpkg', '--module-name', 'docpkg', '--path', self.cloned_repo_path, 'lint'] + cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'lint'] with patch('sys.argv', new=cli_cmd): cli = self.new_cli() @@ -880,7 +837,7 @@ class TestLint(CliTestCase): def test_lint_warning_with_info(self, _run_command): self.checkout_branch(git.Repo(self.cloned_repo_path), 'eng-rhel-7') - cli_cmd = ['rpkg', '--module-name', 'docpkg', '--path', self.cloned_repo_path, + cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'lint', '--info'] with patch('sys.argv', new=cli_cmd): @@ -1200,7 +1157,7 @@ class TestImportSrpm(LookasideCacheMock, CliTestCase): super(TestImportSrpm, self).tearDown() def assert_import_srpm(self, target_repo): - cli_cmd = ['rpkg', '--path', target_repo, '--module-name', 'docpkg', + cli_cmd = ['rpkg', '--path', target_repo, 'import', '--skip-diffs', self.srpm_file] with patch('sys.argv', new=cli_cmd):