Skip to content

Instantly share code, notes, and snippets.

@digitalformula
Created February 15, 2016 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalformula/aea21908a4189d0e02fb to your computer and use it in GitHub Desktop.
Save digitalformula/aea21908a4189d0e02fb to your computer and use it in GitHub Desktop.
nutanix-cluster-info.py - Updated variable substitution section for @MillenniaTom
# substitute the template variables for actual cluster data
template = source_html.safe_substitute(
day=day,
now=time,
name=name,
username=getpass.getuser(),
cluster_name=str(cluster_in["name"]),
cluster_ip=str(cluster_in["clusterExternalIPAddress"]) if cluster_in["clusterExternalIPAddress"] else "Not set",
nodes=str(cluster_in["numNodes"]),
nos=str(cluster_in["version"]),
hypervisors=hypervisors,
models=str(node_models),
timezone=str(cluster_in["timezone"]),
ntp_servers=str(ntp_servers),
name_servers=str(name_servers),
desired_rf=cluster_in["clusterRedundancyState"]["desiredRedundancyFactor"],
actual_rf=cluster_in["clusterRedundancyState"]["currentRedundancyFactor"],
nos_full=str(cluster_in["fullVersion"]),
containers=str(containers),
container_count=container_in["metadata"]["grandTotalEntities"],
computer_name=socket.gethostname()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment