Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
482 changes: 317 additions & 165 deletions provision/acc_provision/acc_provision.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion provision/acc_provision/acc_retrieve_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def kubectl(kind, name, namespace=None):
def get_secret(name, namespace, *keys):
ret = []
data = kubectl('secret', name, namespace)
decode = lambda k: data.get(k) and base64.b64decode(data[k].decode("ascii"))
def decode(k): return data.get(
k) and base64.b64decode(data[k].decode("ascii"))
if keys:
ret = map(decode, keys)
return ret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def url(self, path):
return "http://%s%s" % (self.addr, path)

def get(self, path, data=None, params=None):
args = dict(data=data, cookies=self.cookies, verify=self.verify, params=params)
args = dict(data=data, cookies=self.cookies,
verify=self.verify, params=params)
args.update(timeout=self.timeout)
dbg("getting path: {} {}".format(path, json.dumps(args)))
resp = requests.get(self.url(path), **args)
Expand Down Expand Up @@ -148,7 +149,8 @@ def login(self):
else:
print("Login failed - {}".format(req.text))
print(
"Addr: {} u: {} p: {}".format(self.addr, self.username, self.password)
"Addr: {} u: {} p: {}".format(
self.addr, self.username, self.password)
)
return req

Expand Down Expand Up @@ -465,7 +467,8 @@ def main(args=None):
config["aci_config"]["apic_login"]["username"] = args.username

config["aci_config"]["apic_login"]["password"] = (
args.password if args.password else os.environ.get("ACC_PROVISION_PASS")
args.password if args.password else os.environ.get(
"ACC_PROVISION_PASS")
)
config["aci_config"]["apic_login"]["timeout"] = timeout

Expand Down
Loading