diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2019-12-20 15:18:53 -0500 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2019-12-20 13:18:53 -0700 |
commit | 3bc8790711aaf689ae957748a131be782167db97 (patch) | |
tree | 622a23d594edfcb565db2a3fc9102569af7d89bf /tools/migrate-lp-user-to-github | |
parent | 2ddb9fec323d9cc315f08456d45ef613ebc64626 (diff) | |
download | vyos-cloud-init-3bc8790711aaf689ae957748a131be782167db97.tar.gz vyos-cloud-init-3bc8790711aaf689ae957748a131be782167db97.zip |
migrate-lp-user-to-github: ensure Launchpad repo exists (#136)
* migrate-lp-user-to-github: remove unused option
* migrate-lp-user-to-github: ensure Launchpad repo exists
* migrate-lp-user-to-github: typo fix
Diffstat (limited to 'tools/migrate-lp-user-to-github')
-rwxr-xr-x | tools/migrate-lp-user-to-github | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/migrate-lp-user-to-github b/tools/migrate-lp-user-to-github index 1c058183..f1247cb3 100755 --- a/tools/migrate-lp-user-to-github +++ b/tools/migrate-lp-user-to-github @@ -83,9 +83,6 @@ def get_parser(): parser.add_argument( '-v', '--verbose', required=False, default=False, action='store_true', help=('Print all actions.')) - parser.add_argument( - '--push-remote', required=False, dest='pushremote', - help=('QA-only provide remote name into which you want to push')) return parser @@ -122,7 +119,12 @@ def add_lp_and_github_remotes(lp_user, gh_user): " LP repo".format(lp_user)) lp_remote_name = 'launchpad-{}'.format(lp_user) subp(['git', 'remote', 'add', lp_remote_name, lp_remote]) - subp(['git', 'fetch', lp_remote_name]) + try: + subp(['git', 'fetch', lp_remote_name]) + except: + log("launchpad: Pushing to ensure LP repo exists") + subp(['git', 'push', lp_remote_name, 'master:master']) + subp(['git', 'fetch', lp_remote_name]) if not gh_remote_name: log("github: Creating git remote github-{} to point at your" " GH repo".format(gh_user)) @@ -184,7 +186,7 @@ def main(): cleanup_repo_dir = False cwd = os.getcwd() os.chdir(repo_dir) - log("Sycing master branch with upstream") + log("Syncing master branch with upstream") subp(['git', 'checkout', 'master']) subp(['git', 'pull']) try: |