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
=== modified file 'lib/lp/soyuz/doc/sampledata-setup.txt'
--- lib/lp/soyuz/doc/sampledata-setup.txt 2010-03-18 21:30:51 +0000
+++ lib/lp/soyuz/doc/sampledata-setup.txt 2010-08-13 03:02:42 +0000
@@ -1,5 +1,7 @@
1= Sample data setup =1= Sample data setup =
22
3# XXX: StevenK 2010-07-13 bug=617164: Calling utility scripts is bad
4
3In order to run Soyuz locally on a development system, the sample data5In order to run Soyuz locally on a development system, the sample data
4must be cleaned up and customized a bit. This is done by a the script6must be cleaned up and customized a bit. This is done by a the script
5utilities/soyuz-sampledata-setup.py.7utilities/soyuz-sampledata-setup.py.
68
=== modified file 'utilities/make-lp-user'
--- utilities/make-lp-user 2010-07-22 17:32:26 +0000
+++ utilities/make-lp-user 2010-08-13 03:02:42 +0000
@@ -109,24 +109,17 @@
109 """109 """
110 ssh_dir = os.path.expanduser('~/.ssh')110 ssh_dir = os.path.expanduser('~/.ssh')
111 key_set = getUtility(ISSHKeySet)111 key_set = getUtility(ISSHKeySet)
112 key_guesses = [112 for filename in ('id_rsa.pub', 'id_dsa.pub'):
113 ("ssh-rsa", 'id_rsa.pub'),
114 ("ssh-dsa", 'id_dsa.pub'),
115 ]
116 for key_type, guessed_filename in key_guesses:
117 guessed_filename = os.path.join(ssh_dir, guessed_filename)
118 try:113 try:
119 public_key_file = open(guessed_filename, 'r')114 public_key_file = open(filename, 'r')
120 try:115 try:
121 public_key = public_key_file.read()116 public_key = public_key_file.read()
122 finally:117 finally:
123 public_key_file.close()118 public_key_file.close()
124 except (OSError, IOError):119 except (OSError, IOError):
125 continue120 continue
126 public_key = public_key.split()[1]121 key_set.new(person, public_key)
127 key_set.new(person,122 print 'Registered SSH key: %s' % (filename,)
128 "%s %s %s" % (key_type, public_key, 'Added by utility script.'))
129 print 'Registered SSH key: %s' % (guessed_filename,)
130123
131124
132def parse_fingerprints(gpg_output):125def parse_fingerprints(gpg_output):