#437 Pass --enable-network to mock
Merged 5 years ago by onosek. Opened 5 years ago by onosek.
onosek/rpkg mock_enable_network  into  master

file modified
+5
@@ -1090,6 +1090,8 @@ 

          mockbuild_parser.add_argument(

              '--disablerepo', action='append',

              help='Pass disablerepo option to yum/dnf (may be used more than once)')

+         mockbuild_parser.add_argument(

+             '--enable-network', action='store_true', help='Enable networking')

          mockbuild_parser.set_defaults(command=self.mockbuild)

  

      def register_mock_config(self):
@@ -2082,6 +2084,9 @@ 

              for repo_value in self.args.disablerepo:

                  mockargs.extend(['--disablerepo', repo_value])

  

+         if self.args.enable_network:

+             mockargs.append('--enable-network')

+ 

          # Pick up any mockargs from the env

          try:

              mockargs += os.environ['MOCKARGS'].split()

file modified
+3 -1
@@ -1454,12 +1454,14 @@ 

                     '--release', 'rhel-6', 'mockbuild',

                     '--root', '/etc/mock/some-root',

                     '--enablerepo', 'FAVOURITE_REPO', '--disablerepo', 'UNWANTED_REPO',

-                    '--enablerepo', 'ANOTHER_FAVOURITE_REPO']

+                    '--enablerepo', 'ANOTHER_FAVOURITE_REPO',

+                    '--enable-network']

          cli = self.mockbuild(cli_cmd)

  

          expected_cmd = ['mock', '--enablerepo', 'FAVOURITE_REPO',

                          '--enablerepo', 'ANOTHER_FAVOURITE_REPO',

                          '--disablerepo', 'UNWANTED_REPO',

+                         '--enable-network',

                          '-r', '/etc/mock/some-root',

                          '--resultdir', cli.cmd.mock_results_dir, '--rebuild',

                          cli.cmd.srpmname]

Mockbuild: pass --enable-network to mock command.

JIRA: COMPOSE-3371
Fixes: https://pagure.io/fedpkg/issue/314

Signed-off-by: Ondrej Nosek onosek@redhat.com

newtworkingnetworking

Other thank the typo this looks good to me.

rebased onto 1774559

5 years ago

Pull-Request has been merged by onosek

5 years ago