mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
Added protetecion if the arguments are not there.
This commit is contained in:
parent
3dd62a5c65
commit
7802db4862
@ -1,7 +1,13 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
nodes = json.loads(sys.argv[1])
|
# This script helps parse out the private IP addreses from the
|
||||||
for num in nodes:
|
# `juju run` command's JSON object, see cluster/juju/util.sh
|
||||||
print num['Stdout'].rstrip()
|
|
||||||
|
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
print(sys.argv[1])
|
||||||
|
# It takes the JSON output as the first argument.
|
||||||
|
nodes = json.loads(sys.argv[1])
|
||||||
|
# There can be multiple nodes to print the Stdout.
|
||||||
|
for num in nodes:
|
||||||
|
print num['Stdout'].rstrip()
|
||||||
|
Loading…
Reference in New Issue
Block a user