Merge lp:~stevenk/launchpad/fix-ssh-keys-make-lp-user into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 11342
Proposed branch: lp:~stevenk/launchpad/fix-ssh-keys-make-lp-user
Merge into: lp:launchpad
Diff against target: 44 lines (+6/-11)
2 files modified
lib/lp/soyuz/doc/sampledata-setup.txt (+2/-0)
utilities/make-lp-user (+4/-11)
To merge this branch: bzr merge lp:~stevenk/launchpad/fix-ssh-keys-make-lp-user
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+32543@code.launchpad.net

Commit message

Fix the addition of SSH keys in utilities/make-lp-user.

Description of the change

This branch fixes the addition of DSA SSH keys in utilities/make-lp-user. The current way is wrong, since the code itself was splitting the key up, and it was using the wrong key-type for DSA keys, it's actually ssh-dss.

Why haven't we seen this before, since utilities/make-lp-user is running (indirectly) via the test suite? I suspect the reason for this is because the ec2 and buildbot machines don't actually get to the line that adds the keys, since they don't have any keys, most developers don't run the entire test suite on their machines, and the test that triggers this bug is a soyuz sampledata test.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

utilities/make-lp-user should not be used by the test suite.

What soyuz test uses it?

review: Needs Information
Revision history for this message
Tim Penhey (thumper) wrote :

https://dev.launchpad.net/PolicyandProcess/XXXPolicy specifies a particular format for XXX comments.

Can you please update it to match the policy. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/doc/sampledata-setup.txt'
2--- lib/lp/soyuz/doc/sampledata-setup.txt 2010-03-18 21:30:51 +0000
3+++ lib/lp/soyuz/doc/sampledata-setup.txt 2010-08-13 03:02:42 +0000
4@@ -1,5 +1,7 @@
5 = Sample data setup =
6
7+# XXX: StevenK 2010-07-13 bug=617164: Calling utility scripts is bad
8+
9 In order to run Soyuz locally on a development system, the sample data
10 must be cleaned up and customized a bit. This is done by a the script
11 utilities/soyuz-sampledata-setup.py.
12
13=== modified file 'utilities/make-lp-user'
14--- utilities/make-lp-user 2010-07-22 17:32:26 +0000
15+++ utilities/make-lp-user 2010-08-13 03:02:42 +0000
16@@ -109,24 +109,17 @@
17 """
18 ssh_dir = os.path.expanduser('~/.ssh')
19 key_set = getUtility(ISSHKeySet)
20- key_guesses = [
21- ("ssh-rsa", 'id_rsa.pub'),
22- ("ssh-dsa", 'id_dsa.pub'),
23- ]
24- for key_type, guessed_filename in key_guesses:
25- guessed_filename = os.path.join(ssh_dir, guessed_filename)
26+ for filename in ('id_rsa.pub', 'id_dsa.pub'):
27 try:
28- public_key_file = open(guessed_filename, 'r')
29+ public_key_file = open(filename, 'r')
30 try:
31 public_key = public_key_file.read()
32 finally:
33 public_key_file.close()
34 except (OSError, IOError):
35 continue
36- public_key = public_key.split()[1]
37- key_set.new(person,
38- "%s %s %s" % (key_type, public_key, 'Added by utility script.'))
39- print 'Registered SSH key: %s' % (guessed_filename,)
40+ key_set.new(person, public_key)
41+ print 'Registered SSH key: %s' % (filename,)
42
43
44 def parse_fingerprints(gpg_output):