Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoo-keys:gsoc-2016 commit in: gkeys/gkeys/
Date: Sat, 24 Dec 2016 09:13:58
Message-Id: 1482570668.b98bb5be852b3a5a5bcf52830a51a653c9ab20e5.dolsen@gentoo
1 commit: b98bb5be852b3a5a5bcf52830a51a653c9ab20e5
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 24 09:11:08 2016 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 24 09:11:08 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=b98bb5be
7
8 gkeys base.py: Remove the auto-update code from run()
9
10 This code was causing the fetch-seed action to fail with empty urls to connect to.
11 This code should also not be running directly from the CliBase class.
12 I'll move this code to the actions or lib class, to be determined later.
13
14 gkeys/gkeys/base.py | 22 ++++++++++++----------
15 1 file changed, 12 insertions(+), 10 deletions(-)
16
17 diff --git a/gkeys/gkeys/base.py b/gkeys/gkeys/base.py
18 index 28dd0b2..fb4465f 100644
19 --- a/gkeys/gkeys/base.py
20 +++ b/gkeys/gkeys/base.py
21 @@ -358,14 +358,7 @@ class CliBase(object):
22 return False
23 return True
24
25 -
26 - def run(self, args):
27 - '''Run the action selected
28 -
29 - @param args: list of argumanets to parse
30 - '''
31 - # establish our actions instance
32 - self.actions = self.cli_config['Actions'](self.config, self.output_results, self.logger)
33 + def _upadate_seeds(self):
34 # check for seed update
35 from sslfetch.connections import Connector
36 connector_output = {
37 @@ -390,14 +383,14 @@ class CliBase(object):
38 timestamp_path = filepath + ".timestamp"
39 url = self.config.defaults['seedurls'][category]
40 success, signedfile, timestamp = fetcher.fetch_file(
41 - url, filepath, timestamp_path)
42 + url, filepath, timestamp_path, climit=0)
43 if timestamp != "":
44 up_to_date = False
45 successes.append(success)
46 url += ".sig"
47 filepath += ".sig"
48 success, signedfile, timestamp = fetcher.fetch_file(
49 - url, filepath, timestamp_path)
50 + url, filepath, timestamp_path, climit=0)
51 if timestamp != "":
52 up_to_date = False
53 successes.append(success)
54 @@ -419,6 +412,15 @@ class CliBase(object):
55 print("Seeds are up to date")
56 else:
57 print("Seed update check failed, check your internet connection.")
58 +
59 +
60 + def run(self, args):
61 + '''Run the action selected
62 +
63 + @param args: list of argumanets to parse
64 + '''
65 + # establish our actions instance
66 + self.actions = self.cli_config['Actions'](self.config, self.output_results, self.logger)
67 # run the action
68 func = getattr(self.actions, '%s'
69 % self.cli_config['Action_Map'][args.action]['func'])