Created
February 15, 2016 12:28
-
-
Save digitalformula/aea21908a4189d0e02fb to your computer and use it in GitHub Desktop.
nutanix-cluster-info.py - Updated variable substitution section for @MillenniaTom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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