mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-15 23:05:57 +01:00
Remove print in python test case
Signed-off-by: Yang Jiao <jiaoya@vmware.com>
This commit is contained in:
parent
7b7b51be3c
commit
f0267923fd
@ -6,7 +6,6 @@ import docker_api
|
|||||||
|
|
||||||
def ctr_images_pull(username, password, oci):
|
def ctr_images_pull(username, password, oci):
|
||||||
command = ["ctr", "images", "pull","--snapshotter", "native", "-u", username+":"+password, oci]
|
command = ["ctr", "images", "pull","--snapshotter", "native", "-u", username+":"+password, oci]
|
||||||
print("Command: ", command)
|
|
||||||
ret = base.run_command(command)
|
ret = base.run_command(command)
|
||||||
print("Command return: ", ret)
|
print("Command return: ", ret)
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ def docker_login_cmd(harbor_host, username, password, cfg_file = "./tests/apites
|
|||||||
print("[Warnig]: No docker credential was provided.")
|
print("[Warnig]: No docker credential was provided.")
|
||||||
return
|
return
|
||||||
command = ["docker", "login", harbor_host, "-u", username, "-p", password]
|
command = ["docker", "login", harbor_host, "-u", username, "-p", password]
|
||||||
print( "Docker Login Command: ", command)
|
|
||||||
base.run_command(command)
|
base.run_command(command)
|
||||||
if enable_manifest == True:
|
if enable_manifest == True:
|
||||||
try:
|
try:
|
||||||
@ -79,7 +78,6 @@ def list_repositories(harbor_host, username, password, n = None, last = None):
|
|||||||
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/_catalog"+"?n=%d"%n, "--insecure"]
|
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/_catalog"+"?n=%d"%n, "--insecure"]
|
||||||
else:
|
else:
|
||||||
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/_catalog", "--insecure"]
|
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/_catalog", "--insecure"]
|
||||||
print( "List Repositories Command: ", command)
|
|
||||||
ret = base.run_command(command)
|
ret = base.run_command(command)
|
||||||
repos = json.loads(ret).get("repositories","")
|
repos = json.loads(ret).get("repositories","")
|
||||||
return repos
|
return repos
|
||||||
@ -91,7 +89,6 @@ def list_image_tags(harbor_host, repository, username, password, n = None, last
|
|||||||
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/"+repository+"/tags/list"+"?n=%d"%n, "--insecure"]
|
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/"+repository+"/tags/list"+"?n=%d"%n, "--insecure"]
|
||||||
else:
|
else:
|
||||||
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/"+repository+"/tags/list", "--insecure"]
|
command = ["curl", "-s", "-u", username+":"+password, "https://"+harbor_host+"/v2/"+repository+"/tags/list", "--insecure"]
|
||||||
print( "List Image Tags Command: ", command)
|
|
||||||
ret = base.run_command(command)
|
ret = base.run_command(command)
|
||||||
tags = json.loads(ret).get("tags","")
|
tags = json.loads(ret).get("tags","")
|
||||||
return tags
|
return tags
|
||||||
@ -112,7 +109,6 @@ class DockerAPI(object):
|
|||||||
if registry == "docker":
|
if registry == "docker":
|
||||||
registry = None
|
registry = None
|
||||||
try:
|
try:
|
||||||
print("Docker login: {}:{}:{}".format(registry,username,password))
|
|
||||||
ret = self.DCLIENT.login(registry = registry, username=username, password=password)
|
ret = self.DCLIENT.login(registry = registry, username=username, password=password)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print( "Docker image pull catch exception:", str(err))
|
print( "Docker image pull catch exception:", str(err))
|
||||||
|
@ -507,7 +507,6 @@ class HarborAPI:
|
|||||||
],
|
],
|
||||||
"enabled":webhook["enabled"]
|
"enabled":webhook["enabled"]
|
||||||
}
|
}
|
||||||
print(payload)
|
|
||||||
body=dict(body=payload)
|
body=dict(body=payload)
|
||||||
request(url+"projects/"+projectid+"/webhook/policies", 'post', **body)
|
request(url+"projects/"+projectid+"/webhook/policies", 'post', **body)
|
||||||
elif kwargs["branch"] == 2:
|
elif kwargs["branch"] == 2:
|
||||||
@ -536,7 +535,6 @@ class HarborAPI:
|
|||||||
"enabled":webhook["enabled"],
|
"enabled":webhook["enabled"],
|
||||||
"name":webhook["name"]
|
"name":webhook["name"]
|
||||||
}
|
}
|
||||||
print(payload)
|
|
||||||
body=dict(body=payload)
|
body=dict(body=payload)
|
||||||
request(url+"projects/"+projectid+"/webhook/policies", 'post', **body)
|
request(url+"projects/"+projectid+"/webhook/policies", 'post', **body)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user