diff options
author | 2016-12-24 01:11:08 -0800 | |
---|---|---|
committer | 2018-07-06 22:22:10 -0700 | |
commit | 5ac5f27889115cd48e89e910a3d12380367cccb6 (patch) | |
tree | a40a2800e38c1263aba5ac4133ce3b1e936ef9e6 | |
parent | gkeys seedhandler.py: Add another debug log for the seedurl and seedpath (diff) | |
download | gentoo-keys-5ac5f27889115cd48e89e910a3d12380367cccb6.tar.gz gentoo-keys-5ac5f27889115cd48e89e910a3d12380367cccb6.tar.bz2 gentoo-keys-5ac5f27889115cd48e89e910a3d12380367cccb6.zip |
gkeys base.py: Remove the auto-update code from run()
This code was causing the fetch-seed action to fail with empty urls to connect to.
This code should also not be running directly from the CliBase class.
I'll move this code to the actions or lib class, to be determined later.
-rw-r--r-- | gkeys/gkeys/base.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/gkeys/gkeys/base.py b/gkeys/gkeys/base.py index 3ecbd1b..a67b330 100644 --- a/gkeys/gkeys/base.py +++ b/gkeys/gkeys/base.py @@ -358,7 +358,6 @@ class CliBase(object): return False return True - def run(self, args): '''Run the action selected @@ -366,63 +365,6 @@ class CliBase(object): ''' # establish our actions instance self.actions = self.cli_config['Actions'](self.config, self.output_results, self.logger) - # check for seed update - from sslfetch.connections import Connector - connector_output = { - 'info': self.logger.info, - 'debug': self.logger.debug, - 'error': self.logger.error, - 'exception': self.logger.exception, - 'warning': self.warning_output, - 'kwargs-info': {}, - 'kwargs-debug': {}, - 'kwargs-error': {}, - 'kwargs-exception': {}, - 'kwargs-warning': {}, - } - fetcher = Connector(connector_output, None, "Gentoo Keys") - successes = [] - up_to_date = True - categories = list(self.config.defaults['seeds']) - '''Attemp to download seed and seed.sig files for each available category''' - for category in categories: - filepath = self.config.defaults['seedsdir'] + "/" + category + ".seeds" - timestamp_path = filepath + ".timestamp" - url = self.config.defaults['seedurls'][category] - success, signedfile, timestamp = fetcher.fetch_file( - url, filepath, timestamp_path) - if timestamp != "": - up_to_date = False - successes.append(success) - url += ".sig" - filepath += ".sig" - success, signedfile, timestamp = fetcher.fetch_file( - url, filepath, timestamp_path) - if timestamp != "": - up_to_date = False - successes.append(success) - if False not in successes and not up_to_date: - print("Seeds need to be updated") - ack = None - while ack not in ("y", "yes", "n", "no"): - ack = py_input("Would you like to update the seeds now? (y/n) ").lower() - if ack in ("y", "yes"): - custom_args = copy.copy(args) - for attr in GKEY._fields: - if attr != "debug": - custom_args.attr = None - custom_args.category = None - custom_args.action = "update-seed" - print("Updating seeds") - self.run(custom_args) - elif False not in successes: - print("Seeds are up to date") - else: -<<<<<<< HEAD - print("Seed update check failed, check your internet connection.") -======= - print("Seed update check failed, check your internet connection.") ->>>>>>> b9e64a9... gkeys actions: Added automatic seeds,keys update capability # run the action func = getattr(self.actions, '%s' % self.cli_config['Action_Map'][args.action]['func']) |