diff --git a/examples/dump-repos b/examples/dump-repos index 9a2dc09a..fe04e2e7 100755 --- a/examples/dump-repos +++ b/examples/dump-repos @@ -56,7 +56,7 @@ def make_client(args): log.warning("No password provided for %s", args.username) auth = (args.username, args.password) - return Client(args.url, auth=auth) + return Client(args.url, auth=auth, verify=not args.insecure) def main(): @@ -71,6 +71,7 @@ def main(): parser.add_argument( "--password", help="Pulp password (or set PULP_PASSWORD in env)" ) + parser.add_argument("--insecure", default=False, action="store_true") parser.add_argument("--debug", action="store_true") parser.add_argument( "search", nargs="*", help="Dump repos matching certain criteria only" diff --git a/examples/garbage-collect b/examples/garbage-collect index 6f4ac1ce..5ae3cedc 100755 --- a/examples/garbage-collect +++ b/examples/garbage-collect @@ -42,19 +42,20 @@ def make_client(args): log.warning("No password provided for %s", args.username) auth = (args.username, args.password) - return Client(args.url, auth=auth) + return Client(args.url, auth=auth, verify=not args.insecure) def main(): log.setLevel(logging.INFO) logging.basicConfig(format="%(message)s") - parser = ArgumentParser(help="Garbage collect old repositories") + parser = ArgumentParser(description="Garbage collect old repositories") parser.add_argument("--url", help="Pulp server URL") parser.add_argument("--username", help="Pulp username") parser.add_argument( "--password", help="Pulp password (or set PULP_PASSWORD in env)" ) + parser.add_argument("--insecure", default=False, action="store_true") p = parser.parse_args() if not p.url: diff --git a/examples/publish b/examples/publish index 9fba820b..334b738b 100755 --- a/examples/publish +++ b/examples/publish @@ -37,7 +37,7 @@ def make_client(args): log.warning("No password provided for %s", args.username) auth = (args.username, args.password) - return Client(args.url, auth=auth) + return Client(args.url, auth=auth, verify=not args.insecure) def main(): @@ -50,6 +50,7 @@ def main(): parser.add_argument( "--password", help="Pulp password (or set PULP_PASSWORD in env)" ) + parser.add_argument("--insecure", default=False, action="store_true") parser.add_argument("--debug", action="store_true") parser.add_argument("repo_id", nargs="+") diff --git a/examples/set-maintenance b/examples/set-maintenance index fc804bfc..fa17483c 100755 --- a/examples/set-maintenance +++ b/examples/set-maintenance @@ -15,13 +15,13 @@ def set_maintenance(client, regex): crit = Criteria.with_field("id", Matcher.regex(regex)) # search repo - repos = self.search_repository(crit).result() + repos = client.search_repository(crit).result() repo_ids = [repo.id for repo in repos] report = report.add(repo_ids) # get the repo ids and feed to report - tasks = client.set_maintainenance(report).result() + tasks = client.set_maintenance(report).result() report = client.get_maintenance_report().result() log.info("maintenance mode set: %s", report.entries)