1 |
commit: 05ec1dd9a237b624354bce496b93aa6b98f63ef2 |
2 |
Author: aeroniero33 <justthisthing <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Jun 9 22:44:16 2016 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 24 04:54:15 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=05ec1dd9 |
7 |
|
8 |
Created the update-seed function |
9 |
|
10 |
gkeys/gkeys/action_map.py | 19 ++++++++++++++++++- |
11 |
gkeys/gkeys/actions.py | 14 +++++++++++++- |
12 |
2 files changed, 31 insertions(+), 2 deletions(-) |
13 |
|
14 |
diff --git a/gkeys/gkeys/action_map.py b/gkeys/gkeys/action_map.py |
15 |
index f372a5c..1bd0625 100644 |
16 |
--- a/gkeys/gkeys/action_map.py |
17 |
+++ b/gkeys/gkeys/action_map.py |
18 |
@@ -15,7 +15,8 @@ from collections import OrderedDict |
19 |
|
20 |
|
21 |
Seed_Actions = ['----seeds----', 'add-seed', 'fetch-seed', |
22 |
- 'list-seed', 'list-seedfiles', 'move-seed', 'remove-seed'] |
23 |
+ 'update-seed', 'list-seed', 'list-seedfiles', 'move-seed', |
24 |
+ 'remove-seed'] |
25 |
|
26 |
Key_Actions = ['----keys-----', 'check-key', 'installed', |
27 |
'install-key', 'list-key', 'send-key', 'refresh-key', 'remove-key', |
28 |
@@ -380,6 +381,22 @@ Found Failures: |
29 |
Fetch operation completed |
30 |
''', |
31 |
}), |
32 |
+ ('update-seed', { |
33 |
+ 'func': 'updateseed', |
34 |
+ 'options': ['category', 'nick', '1file', 'dest', 'signature', |
35 |
+ 'timestamp'], |
36 |
+ 'desc': '''Update the selected seed file(s)''', |
37 |
+ 'long_desc': '''Update the selected seed file(s)''', |
38 |
+ 'example': '''$ gkeys update-seed -C gentoo-devs |
39 |
+ |
40 |
+ Gkey task results: |
41 |
+ Verification succeeded.: /home/brian/gpg-test/seeds/gentoo-devs.seeds |
42 |
+ Key info...............: Gentoo-Linux Gentoo-keys Project Signing Key <gkeys>, 0xA41DBBD9151C3FC7 |
43 |
+ category, nick.....: gentoo gkeys |
44 |
+ |
45 |
+ Update operation completed |
46 |
+''', |
47 |
+ }), |
48 |
('list-seed', { |
49 |
'func': 'listseed', |
50 |
'options': ['category', 'nick', 'name', 'fingerprint', 'keys', |
51 |
|
52 |
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py |
53 |
index 3070eb3..c218d8d 100644 |
54 |
--- a/gkeys/gkeys/actions.py |
55 |
+++ b/gkeys/gkeys/actions.py |
56 |
@@ -96,7 +96,19 @@ class Actions(ActionBase): |
57 |
messages.append("") |
58 |
messages.append("Fetch operation completed") |
59 |
return (False not in success, messages) |
60 |
- |
61 |
+ |
62 |
+ def updateseed(self, args): |
63 |
+ '''Updates seeds of a selected file''' |
64 |
+ self.logger.debug(_unicode("ACTIONS: updateseed; args: %s") |
65 |
+ % _unicode(args)) |
66 |
+ fetch_success, fetch_messages = self.fetchseed(args) |
67 |
+ if fetch_success is not True: |
68 |
+ return (False, fetch_messages) |
69 |
+ install_success, install_messages = self.installkey(args) |
70 |
+ if install_success is not True: |
71 |
+ return (False, install_messages) |
72 |
+ messages = fetch_messages + [install_messages] |
73 |
+ return (True, messages) |
74 |
|
75 |
def addseed(self, args): |
76 |
'''Add or replace a key in the selected seed file''' |