commit 468f48daef9630afadc596ffc1aa09ea6d9233fe
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Aug 3 16:23:17 2014 +0200
Do one API call for `orphan --retire`
This will prevent the situation where the user orphans a package and then try to
retire it which leads to two API calls while when calling the retire package
endpoint we achieve the same result in only one call.
pkgdb2client/cli.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/pkgdb2client/cli.py b/pkgdb2client/cli.py
index 592c47c..ba605cf 100644
--- a/pkgdb2client/cli.py
+++ b/pkgdb2client/cli.py
@@ -554,14 +554,13 @@ def do_orphan(args):
pkgdbclient.username = args.username
- output = pkgdbclient.orphan_packages(pkgs, branches)
- for msg in output.get('messages', []):
- print msg
-
if args.retire is True:
output = pkgdbclient.retire_packages(pkgs, branches)
- for msg in output.get('messages', []):
- print msg
+ else:
+ output = pkgdbclient.orphan_packages(pkgs, branches)
+
+ for msg in output.get('messages', []):
+ print msg
def do_unorphan(args):