From 02f871da64811a0d4c537582360aabc7968a82b8 Mon Sep 17 00:00:00 2001
From: Chenxiong Qi <cqi@redhat.com>
Date: Jun 25 2018 07:09:58 +0000
Subject: Do not use deprecated option module-name


Signed-off-by: Chenxiong Qi <cqi@redhat.com>

---

diff --git a/conf/etc/rpkg/fedpkg-stage.conf b/conf/etc/rpkg/fedpkg-stage.conf
index 9a2180b..37033cb 100644
--- a/conf/etc/rpkg/fedpkg-stage.conf
+++ b/conf/etc/rpkg/fedpkg-stage.conf
@@ -2,8 +2,8 @@
 lookaside = https://src.stg.fedoraproject.org/repo/pkgs
 lookasidehash = sha512
 lookaside_cgi = https://src.stg.fedoraproject.org/repo/pkgs/upload.cgi
-gitbaseurl = ssh://%(user)s@pkgs.stg.fedoraproject.org/%(module)s
-anongiturl = https://src.stg.fedoraproject.org/%(module)s.git
+gitbaseurl = ssh://%(user)s@pkgs.stg.fedoraproject.org/%(repo)s
+anongiturl = https://src.stg.fedoraproject.org/%(repo)s.git
 branchre = f\d$|f\d\d$|el\d$|olpc\d$|master$
 kojiprofile = stg
 build_client = koji
@@ -11,8 +11,8 @@ clone_config =
   bz.default-tracker partner-bugzilla.redhat.com
   bz.default-product Fedora
   bz.default-version rawhide
-  bz.default-component %(base_module)s
-  sendemail.to %(base_module)s-owner@fedoraproject.org
+  bz.default-component %(repo)s
+  sendemail.to %(repo)s-owner@fedoraproject.org
 distgit_namespaced = True
 lookaside_namespaced = True
 kerberos_realms = STG.FEDORAPROJECT.ORG
diff --git a/conf/etc/rpkg/fedpkg.conf b/conf/etc/rpkg/fedpkg.conf
index 5da94c7..5079770 100644
--- a/conf/etc/rpkg/fedpkg.conf
+++ b/conf/etc/rpkg/fedpkg.conf
@@ -2,8 +2,8 @@
 lookaside = https://src.fedoraproject.org/repo/pkgs
 lookasidehash = sha512
 lookaside_cgi = https://src.fedoraproject.org/repo/pkgs/upload.cgi
-gitbaseurl = ssh://%(user)s@pkgs.fedoraproject.org/%(module)s
-anongiturl = https://src.fedoraproject.org/%(module)s.git
+gitbaseurl = ssh://%(user)s@pkgs.fedoraproject.org/%(repo)s
+anongiturl = https://src.fedoraproject.org/%(repo)s.git
 branchre = f\d$|f\d\d$|el\d$|olpc\d$|master$
 kojiprofile = koji
 build_client = koji
@@ -11,8 +11,8 @@ clone_config =
   bz.default-tracker bugzilla.redhat.com
   bz.default-product Fedora
   bz.default-version rawhide
-  bz.default-component %(base_module)s
-  sendemail.to %(base_module)s-owner@fedoraproject.org
+  bz.default-component %(repo)s
+  sendemail.to %(repo)s-owner@fedoraproject.org
 distgit_namespaced = True
 lookaside_namespaced = True
 kerberos_realms = FEDORAPROJECT.ORG
diff --git a/fedpkg/cli.py b/fedpkg/cli.py
index f1537d0..58a1c44 100644
--- a/fedpkg/cli.py
+++ b/fedpkg/cli.py
@@ -114,8 +114,11 @@ user configuration located at ~/.config/rpkg/{0}.conf. For example:
 Below is a basic example of the command to request a dist-git repository for
 the package foo:
 
-    fedpkg --module-name foo request-repo 1234
+    fedpkg --name foo request-repo 1234
 
+Request a module with namespace explicitly:
+
+    fedpkg --name foo --namespace modules request-repo
 '''.format(self.name, urlparse(self.config.get(
             '{0}.pagure'.format(self.name), 'url')).netloc)
 
@@ -151,7 +154,7 @@ the package foo:
         help_msg = 'Request a new tests dist-git repository'
         pagure_url = urlparse(self.config.get(
             '{0}.pagure'.format(self.name), 'url')).netloc
-        anongiturl = self.config.get(self.name, 'anongiturl', vars={'module': 'any'})
+        anongiturl = self.config.get(self.name, 'anongiturl', vars={'repo': 'any'})
         description = '''Request a new dist-git repository in tests shared namespace
 
     {2}/projects/tests/*
@@ -166,7 +169,7 @@ requesting a repository in the tests namespace.
 Below is a basic example of the command to request a dist-git repository for
 the space tests/foo:
 
-    fedpkg --module-name foo request-tests-repo "Description of the repository"
+    fedpkg --name foo request-tests-repo "Description of the repository"
 
 Note that the space name needs to reflect the intent of the tests and will
 undergo a manual review.
@@ -199,7 +202,7 @@ Request a branch inside a cloned package repository:
 Request a branch without waiting for the requested repository to be approved
 and created:
 
-    fedpkg --module-name foo request-branch f27
+    fedpkg --name foo request-branch f27
 
 '''
         request_branch_parser = self.subparsers.add_parser(
@@ -468,7 +471,7 @@ suggest_reboot=False
 
     def request_repo(self):
         self._request_repo(
-            module_name=self.cmd.module_name,
+            repo_name=self.cmd.repo_name,
             ns=self.cmd.ns,
             branch='master',
             summary=self.args.summary,
@@ -483,7 +486,7 @@ suggest_reboot=False
 
     def request_tests_repo(self):
         self._request_repo(
-            module_name=self.cmd.module_name,
+            repo_name=self.cmd.repo_name,
             ns='tests',
             description=self.args.description,
             name=self.name,
@@ -492,15 +495,15 @@ suggest_reboot=False
         )
 
     @staticmethod
-    def _request_repo(module_name, ns, description, name, config, branch=None,
+    def _request_repo(repo_name, ns, description, name, config, branch=None,
                       summary=None, upstreamurl=None, monitor=None, bug=None,
                       exception=None, anongiturl=None):
         """ Implementation of `request_repo`.
 
         Submits a request for a new dist-git repo.
 
-        :param module_name: The repository name string.  Typically the
-            value of `self.cmd.module_name`.
+        :param repo_name: The repository name string.  Typically the
+            value of `self.cmd.repo_name`.
         :param ns: The repository namespace string, i.e. 'rpms' or 'modules'.
             Typically takes the value of `self.cmd.ns`.
         :param description: A string, the description of the new repo.
@@ -538,29 +541,29 @@ suggest_reboot=False
             raise rpkgError(
                 'A Bugzilla bug is required on new repository requests')
         repo_regex = r'^[a-zA-Z0-9_][a-zA-Z0-9-_.+]*$'
-        if not bool(re.match(repo_regex, module_name)):
+        if not bool(re.match(repo_regex, repo_name)):
             raise rpkgError(
                 'The repository name "{0}" is invalid. It must be at least '
                 'two characters long with only letters, numbers, hyphens, '
                 'underscores, plus signs, and/or periods. Please note that '
                 'the project cannot start with a period or a plus sign.'
-                .format(module_name))
+                .format(repo_name))
 
         summary_from_bug = ''
         if bug and ns not in ['tests', 'modules']:
             bz_url = config.get('{0}.bugzilla'.format(name), 'url')
             bz_client = BugzillaClient(bz_url)
-            bug_obj = bz_client.get_review_bug(bug, ns, module_name)
+            bug_obj = bz_client.get_review_bug(bug, ns, repo_name)
             summary_from_bug = bug_obj.summary.split(' - ', 1)[1].strip()
 
         if ns == 'tests':
             # check if tests repository does not exist already
-            assert_new_tests_repo(module_name, get_dist_git_url(anongiturl))
+            assert_new_tests_repo(repo_name, get_dist_git_url(anongiturl))
 
             ticket_body = {
                 'action': 'new_repo',
                 'namespace': 'tests',
-                'repo': module_name,
+                'repo': repo_name,
                 'description': description,
             }
         else:
@@ -572,14 +575,14 @@ suggest_reboot=False
                 'exception': exception,
                 'monitor': monitor,
                 'namespace': ns,
-                'repo': module_name,
+                'repo': repo_name,
                 'summary': summary or summary_from_bug,
                 'upstreamurl': upstreamurl or ''
             }
 
         ticket_body = json.dumps(ticket_body, indent=True)
         ticket_body = '```\n{0}\n```'.format(ticket_body)
-        ticket_title = 'New Repo for "{0}/{1}"'.format(ns, module_name)
+        ticket_title = 'New Repo for "{0}/{1}"'.format(ns, repo_name)
 
         pagure_url = config.get('{0}.pagure'.format(name), 'url')
         pagure_token = get_pagure_token(config, name)
@@ -596,7 +599,7 @@ suggest_reboot=False
             all_releases=self.args.all_releases,
             branch=self.args.branch,
             active_branch=active_branch,
-            module_name=self.cmd.module_name,
+            repo_name=self.cmd.repo_name,
             ns=self.cmd.ns,
             no_git_branch=self.args.no_git_branch,
             no_auto_module=self.args.no_auto_module,
@@ -606,7 +609,7 @@ suggest_reboot=False
 
     @staticmethod
     def _request_branch(service_levels, all_releases, branch, active_branch,
-                        module_name, ns, no_git_branch, no_auto_module,
+                        repo_name, ns, no_git_branch, no_auto_module,
                         name, config):
         """ Implementation of `request_branch`.
 
@@ -619,8 +622,8 @@ suggest_reboot=False
         :param branch: A string specifying the specific branch to be requested.
         :param active_branch: A string (or None) specifying the active branch in
             the current git repo (the branch that is currently checked out).
-        :param module_name: The repository name string.  Typically the
-            value of `self.cmd.module_name`.
+        :param repo_name: The repository name string.  Typically the
+            value of `self.cmd.repo_name`.
         :param ns: The repository namespace string, i.e. 'rpms' or 'modules'.
             Typically takes the value of `self.cmd.ns`.
         :param no_git_branch: A boolean flag.  If True, the SCM admins should
@@ -652,7 +655,7 @@ suggest_reboot=False
         pdc_url = config.get('{0}.pdc'.format(name), 'url')
         if branch:
             if is_epel(branch):
-                assert_valid_epel_package(module_name, branch)
+                assert_valid_epel_package(repo_name, branch)
 
             if ns in ['modules', 'test-modules']:
                 branch_valid = bool(re.match(r'^[a-zA-Z0-9.\-_+]+$', branch))
@@ -693,7 +696,7 @@ suggest_reboot=False
                 'action': 'new_branch',
                 'branch': b,
                 'namespace': ns,
-                'repo': module_name,
+                'repo': repo_name,
                 'create_git_branch': not no_git_branch
             }
             if service_levels:
@@ -702,7 +705,7 @@ suggest_reboot=False
             ticket_body = json.dumps(ticket_body, indent=True)
             ticket_body = '```\n{0}\n```'.format(ticket_body)
             ticket_title = 'New Branch "{0}" for "{1}/{2}"'.format(
-                b, ns, module_name)
+                b, ns, repo_name)
 
             print(new_pagure_issue(
                 pagure_url, pagure_token, ticket_title, ticket_body))
@@ -716,9 +719,9 @@ suggest_reboot=False
             )
             if auto_module:
                 summary = ('Automatically requested module for '
-                           'rpms/%s:%s.' % (module_name, b))
+                           'rpms/%s:%s.' % (repo_name, b))
                 fedpkgClient._request_repo(
-                    module_name=module_name,
+                    repo_name=repo_name,
                     ns='modules',
                     branch='master',
                     summary=summary,
@@ -735,7 +738,7 @@ suggest_reboot=False
                     all_releases=all_releases,
                     branch=b,
                     active_branch=active_branch,
-                    module_name=module_name,
+                    repo_name=repo_name,
                     ns='modules',
                     no_git_branch=no_git_branch,
                     no_auto_module=True,  # Avoid infinite recursion.
diff --git a/test/fedpkg-stage.conf b/test/fedpkg-stage.conf
index c72a29b..206e505 100644
--- a/test/fedpkg-stage.conf
+++ b/test/fedpkg-stage.conf
@@ -1,6 +1,6 @@
 [fedpkg-stage]
-anongiturl = git://pkgs.stg.example.com/%(module)s
-gitbaseurl = ssh://%(user)s@pkgs.stg.example.com/%(module)s
+anongiturl = git://pkgs.stg.example.com/%(repo)s
+gitbaseurl = ssh://%(user)s@pkgs.stg.example.com/%(repo)s
 lookaside_cgi = https://pkgs.stg.example.com/repo/pkgs/upload.cgi
 lookasidehash = sha512
 lookaside = http://pkgs.stg.example.com/repo/pkgs
diff --git a/test/fedpkg-test.conf b/test/fedpkg-test.conf
index 997eebb..3587bc9 100644
--- a/test/fedpkg-test.conf
+++ b/test/fedpkg-test.conf
@@ -1,6 +1,6 @@
 [fedpkg]
-anongiturl = git://pkgs.example.com/%(module)s
-gitbaseurl = ssh://%(user)s@pkgs.example.com/%(module)s
+anongiturl = git://pkgs.example.com/%(repo)s
+gitbaseurl = ssh://%(user)s@pkgs.example.com/%(repo)s
 lookaside_cgi = https://pkgs.example.com/repo/pkgs/upload.cgi
 lookasidehash = sha512
 lookaside = http://pkgs.example.com/repo/pkgs
diff --git a/test/test_cli.py b/test/test_cli.py
index aa922b4..3003eb0 100644
--- a/test/test_cli.py
+++ b/test/test_cli.py
@@ -281,7 +281,7 @@ class TestRequestRepo(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         cli.request_repo()
 
@@ -321,7 +321,8 @@ class TestRequestRepo(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'modules/nethack', 'request-repo']
+                   '--name', 'nethack', '--namespace', 'modules',
+                   'request-repo']
         cli = self.get_cli(cli_cmd)
         cli.request_repo()
 
@@ -360,8 +361,8 @@ class TestRequestRepo(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'container/nethack', 'request-repo',
-                   '1441813']
+                   '--name', 'nethack', '--namespace', 'container',
+                   'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         cli.request_repo()
 
@@ -400,7 +401,7 @@ class TestRequestRepo(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813', '-d',
+                   '--name', 'nethack', 'request-repo', '1441813', '-d',
                    'a description', '-s', 'a summary', '-m', 'no-monitoring',
                    '-u', 'http://test.local']
         cli = self.get_cli(cli_cmd)
@@ -438,7 +439,7 @@ class TestRequestRepo(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '--exception']
+                   '--name', 'nethack', 'request-repo', '--exception']
         cli = self.get_cli(cli_cmd)
         cli.request_repo()
 
@@ -470,7 +471,7 @@ class TestRequestRepo(CliTestCase):
         """Tests request-repo errors when the package is wrong"""
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'not-nethack', 'request-repo', '1441813']
+                   '--name', 'not-nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = ('The package in the Bugzilla bug "nethack" doesn\'t '
                           'match the one provided "not-nethack"')
@@ -485,7 +486,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.product = 'Red Hat'
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = \
             'The Bugzilla bug provided is not for "Fedora" or "Fedora EPEL"'
@@ -500,7 +501,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.summary = 'I am so wrong'
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = \
             'Invalid title for this Bugzilla bug (no ":" present)'
@@ -515,7 +516,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.summary = 'So:Wrong'
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = \
             'Invalid title for this Bugzilla bug (no "-" present)'
@@ -530,7 +531,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.summary = ('Review Request: fedpkg - lorum ipsum')
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = ('The package in the Bugzilla bug "fedpkg" doesn\'t '
                           'match the one provided "nethack"')
@@ -548,7 +549,7 @@ class TestRequestRepo(CliTestCase):
                 '%Y%m%dT%H:%M:%S')
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = \
             'The Bugzilla bug\'s review was approved over 60 days ago'
@@ -563,7 +564,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.flags[0]['name'] = 'something else'
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = 'The Bugzilla bug is not approved yet'
         try:
@@ -577,7 +578,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.assigned_to = None
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = 'The Bugzilla bug provided is not assigned to anyone'
         try:
@@ -591,7 +592,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.product = 'Red Hat'
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', '$nethack', 'request-repo', '1441813']
+                   '--name', '$nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         expected_error = (
             'The repository name "$nethack" is invalid. It must be at least '
@@ -609,7 +610,7 @@ class TestRequestRepo(CliTestCase):
         """Tests a standard request-repo call when the Pagure API call fails"""
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo', '1441813']
+                   '--name', 'nethack', 'request-repo', '1441813']
         cli = self.get_cli(cli_cmd)
         mock_rv = Mock()
         mock_rv.ok = False
@@ -628,7 +629,7 @@ class TestRequestRepo(CliTestCase):
         self.mock_bug.product = 'Red Hat'
         mock_bz.getbug.return_value = self.mock_bug
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-repo']
+                   '--name', 'nethack', 'request-repo']
         cli = self.get_cli(cli_cmd)
         expected_error = \
             'A Bugzilla bug is required on new repository requests'
@@ -700,7 +701,7 @@ class TestRequestBranch(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch', 'f27']
+                   '--name', 'nethack', 'request-branch', 'f27']
         cli = self.get_cli(cli_cmd)
         cli.request_branch()
 
@@ -733,7 +734,8 @@ class TestRequestBranch(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'modules/nethack', 'request-branch', 'f27']
+                   '--name', 'nethack', '--namespace', 'modules',
+                   'request-branch', 'f27']
         cli = self.get_cli(cli_cmd)
         cli.request_branch()
 
@@ -766,8 +768,8 @@ class TestRequestBranch(CliTestCase):
         mock_request_post.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'container/nethack', 'request-branch',
-                   'f27']
+                   '--name', 'nethack', '--namespace', 'container',
+                   'request-branch', 'f27']
         cli = self.get_cli(cli_cmd)
         cli.request_branch()
 
@@ -805,7 +807,7 @@ class TestRequestBranch(CliTestCase):
         mock_request_post.side_effect = responses
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch', '9', '--sl',
+                   '--name', 'nethack', 'request-branch', '9', '--sl',
                    'security_fixes:2030-12-01', 'bug_fixes:2030-12-01']
         cli = self.get_cli(cli_cmd)
         cli.request_branch()
@@ -892,7 +894,7 @@ class TestRequestBranch(CliTestCase):
         mock_request_post.side_effect = post_side_effect
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch',
+                   '--name', 'nethack', 'request-branch',
                    '--all-releases']
         cli = self.get_cli(cli_cmd)
         cli.request_branch()
@@ -921,7 +923,7 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         """Tests request-branch with a branch and the '--all-releases' option
         """
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch', 'f27',
+                   '--name', 'nethack', 'request-branch', 'f27',
                    '--all-releases']
         cli = self.get_cli(cli_cmd)
         expected_error = \
@@ -936,7 +938,7 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         """Tests request-branch with an SL and the '--all-releases' option
         """
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch',
+                   '--name', 'nethack', 'request-branch',
                    '--all-releases', '--sl', 'security_fixes:2020-01-01']
         cli = self.get_cli(cli_cmd)
         expected_error = ('You cannot specify service levels with the '
@@ -953,7 +955,7 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         mock_grb.return_value = set(['el6', 'epel7', 'f25', 'f26', 'f27'])
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch', '9', '--sl',
+                   '--name', 'nethack', 'request-branch', '9', '--sl',
                    'security_fixes-2030-12-01', 'bug_fixes:2030-12-01']
         cli = self.get_cli(cli_cmd)
         expected_error = \
@@ -970,7 +972,7 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         mock_grb.return_value = set(['el6', 'epel7', 'f25', 'f26', 'f27'])
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'nethack', 'request-branch', 'f27', '--sl',
+                   '--name', 'nethack', 'request-branch', 'f27', '--sl',
                    'security_fixes-2030-12-01', 'bug_fixes:2030-12-01']
         cli = self.get_cli(cli_cmd)
         expected_error = 'You can\'t provide SLs for release branches'
@@ -984,8 +986,8 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         """Test request-branch raises an exception when a invalid module branch
         name is supplied"""
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'modules/nethack', 'request-branch',
-                   'some:branch']
+                   '--name', 'nethack', '--namespace', 'modules',
+                   'request-branch', 'some:branch']
         cli = self.get_cli(cli_cmd)
         expected_error = (
             'Only characters, numbers, periods, dashes, underscores, and '
@@ -1001,7 +1003,7 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         """
         tempdir = mkdtemp()
         cli_cmd = ['fedpkg-stage', '--path', tempdir,
-                   '--module-name', 'nethack', 'request-branch']
+                   '--name', 'nethack', 'request-branch']
         cli = self.get_cli(cli_cmd)
         expected_error = (
             'You must specify a branch if you are not in a git repository')
@@ -1032,7 +1034,7 @@ https://pagure.stg.example.com/releng/fedora-scm-requests/issue/3"""
         mock_get.return_value = mock_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'kernel', 'request-branch', 'epel7']
+                   '--name', 'kernel', 'request-branch', 'epel7']
         cli = self.get_cli(cli_cmd)
         expected_error = (
             'This package is already an EL package and is built on all '
@@ -1075,7 +1077,7 @@ class TestRequestTestsRepo(CliTestCase):
         mock_request_post.return_value = mock_post_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'foo', 'request-tests-repo',
+                   '--name', 'foo', 'request-tests-repo',
                    'Some description']
         cli = self.get_cli(cli_cmd)
         cli.request_tests_repo()
@@ -1108,7 +1110,7 @@ class TestRequestTestsRepo(CliTestCase):
         mock_request_get.return_value = mock_get_rv
 
         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,
-                   '--module-name', 'foo', 'request-tests-repo',
+                   '--name', 'foo', 'request-tests-repo',
                    'Some description']
         cli = self.get_cli(cli_cmd)
 

