Ubuntu Pastebin

Paste from nacc at Tue, 18 Apr 2017 15:29:57 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/usd/importer.py b/usd/importer.py
index db78802..a9b8f67 100755
--- a/usd/importer.py
+++ b/usd/importer.py
@@ -1202,11 +1202,18 @@ class USDImport:
             else:
                 self.local_repo.push_lpusip()
             lp = launchpad_login_auth()
-            lp_git_repo = lp.git_repositories.getByPath(
-                              path='~%s/ubuntu/+source/%s/+git/%s' %
-                                   (owner, pkgname, pkgname))
-            if only_debian:
-                lp_git_repo.default_branch = 'refs/heads/debian/sid'
-            else:
-                lp_git_repo.default_branch = 'refs/heads/ubuntu/devel'
-            lp_git_repo.lp_save()
+            updated = False
+            while not updated:
+                try:
+                    lp_git_repo = lp.git_repositories.getByPath(
+                                      path='~%s/ubuntu/+source/%s/+git/%s' %
+                                           (owner, pkgname, pkgname))
+                    if only_debian:
+                        lp_git_repo.default_branch = 'refs/heads/debian/sid'
+                    else:
+                        lp_git_repo.default_branch = 'refs/heads/ubuntu/devel'
+                    lp_git_repo.lp_save()
+                    updated = True
+                except (lazr.restfulclient.errors.NotFound,
+                        lazr.restfulclient.errors.PreconditionFailed) as e:
+                    pass
Download as text