From be848fc12e384aa28849e4f4f8ba2910d3b22646 Mon Sep 17 00:00:00 2001 From: Otto Urpelainen Date: Jul 12 2021 13:02:57 +0000 Subject: Add --offline cli argument for new-sources Cli command new-sources calls command upload, which already had an offline mode. Only thing needed for new-sources --offline support was to add the argument and pass it to upload command. Signed-off-by: Otto Urpelainen --- diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index 6c7eb97..2bcfc6f 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -1248,6 +1248,10 @@ class cliClient(object): 'will be replaced. .gitignore will be also updated ' 'with new uploaded file(s). Please remember to ' 'commit them.') + self.new_sources_parser.add_argument( + '--offline', + help='Do all the steps except uploading into lookaside cache', + action='store_true', dest='offline') self.new_sources_parser.add_argument('files', nargs='+') self.new_sources_parser.set_defaults(command=self.new_sources, replace=True) @@ -2505,7 +2509,10 @@ class cliClient(object): if not os.path.isfile(file): raise Exception('Path does not exist or is ' 'not a file: %s' % file) - self.cmd.upload(self.args.files, replace=self.args.replace) + self.cmd.upload( + self.args.files, + replace=self.args.replace, + offline=self.args.offline,) self.log.info("Source upload succeeded. Don't forget to commit the " "sources file")