make-lp-user is difficult to use with GPG

Bug #2029874 reported by Simon Quigley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

I'm filing this in the hope that part of this diff is useful, since it's what I had to do for make-lp-user to take my GPG key:

diff --git a/configs/development/launchpad-lazr.conf b/configs/development/launchpad-lazr.conf
index 4e804544658..f3fc39cf6ca 100644
--- a/configs/development/launchpad-lazr.conf
+++ b/configs/development/launchpad-lazr.conf
@@ -79,8 +79,8 @@ custom_config_id: 1234567890
 launch: True

 [gpghandler]
-host: keyserver.launchpad.test
-public_host: keyserver.launchpad.test
+host: keyserver.ubuntu.com
+public_host: keyserver.ubuntu.com
 public_https: False

diff --git a/lib/lp/services/gpg/handler.py b/lib/lp/services/gpg/handler.py
index bfd039373ed..4fcd3926ba4 100644
--- a/lib/lp/services/gpg/handler.py
+++ b/lib/lp/services/gpg/handler.py
@@ -473,13 +473,13 @@ def retrieveKey(self, fingerprint):
         # key ring, but it needs "speccing"
         key = PymeKey(fingerprint)
         if not key.exists_in_local_keyring:
- pubkey = self._getPubKey(fingerprint)
+ pubkey = self._getPubKey("5c7abea20f8630459cc8c8b5e27f2cf8458c2fa4")
             key = self.importPublicKey(pubkey)
             if not key.matches(fingerprint):
                 ctx = get_gpgme_context()
- with gpgme_timeline("delete", key.fingerprint):
- ctx.delete(key.key)
- raise GPGKeyMismatchOnServer(fingerprint, key.fingerprint)
+ #with gpgme_timeline("delete", key.fingerprint):
+ # ctx.delete(key.key)
+ #raise GPGKeyMismatchOnServer(fingerprint, key.fingerprint)
         return key

     def retrieveActiveKey(self, fingerprint):
diff --git a/utilities/make-lp-user b/utilities/make-lp-user
index c856fa37d28..e23570993de 100755
--- a/utilities/make-lp-user
+++ b/utilities/make-lp-user
@@ -154,9 +154,9 @@ def add_gpg_key(person, fingerprint):
     run_native_gpg(
         [
             "--keyserver",
- "hkp://keyserver.launchpad.test:11371",
+ "hkp://keyserver.ubuntu.com:11371",
             "--send-key",
- fingerprint,
+ "0x5c7abea20f8630459cc8c8b5e27f2cf8458c2fa4",
         ]
     )

@@ -189,7 +189,7 @@ def attach_gpg_keys(email, person):
     if len(fingerprints) == 0:
         print("No GPG key fingerprints found!")
     for fingerprint in fingerprints:
- add_gpg_key(person, fingerprint)
+ add_gpg_key(person, "5C7ABEA20F8630459CC8C8B5E27F2CF8458C2FA4")

I went through quite a few local iterations. This actually did the trick and added the user.

Revision history for this message
Colin Watson (cjwatson) wrote :

I think it might help if we made `make-lp-user` take the keyserver URL as a command-line option. There are situations in which the public keyserver is useful, and situations in which the test keyserver is useful.

Guruprasad (lgp171188)
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.