<commit_before>from cloudmesh.config.cm_config import cm_config_server
from cloudmesh.inventory import Inventory
from pprint import pprint
from sh import ssh

# class cm_temperature:

hostname = "i066"

config_server = cm_config_server().get("cloudmesh.server.clusters")

inventory = Inventory()

def get_ipmi_temperature(host):

    (hostaddr, data) = inventory.ipadr_cluster (hostname, "bmc")
    clustername = data["cm_cluster"]
    config = config_server[clustername]['bmc']
    password = config['password']
    username = config['user']

    command = "ipmitool -c -I lanplus -U {0} -P {1} -E -H {2} sdr type temperature".format(username, password, hostaddr)

    proxyaddr = config['proxy']['ip']
    proxyusername = config['proxy']['user']

    result = ssh("{0}@{1}".format(proxyusername, proxyaddr), command)

    return result

print get_ipmi_temperature(hostname)<commit_msg>echo temp<commit_after>from cloudmesh.config.cm_config import cm_config_server
from cloudmesh.inventory import Inventory
from pprint import pprint
from sh import ssh

# class cm_temperature:

# hostname = "i066"
hostname = "e003"

config_server = cm_config_server().get("cloudmesh.server.clusters")

inventory = Inventory()

def get_ipmi_temperature(host):

    (hostaddr, data) = inventory.ipadr_cluster (hostname, "bmc")
    clustername = data["cm_cluster"]
    config = config_server[clustername]['bmc']
    password = config['password']
    username = config['user']

    command = "ipmitool -c -I lanplus -U {0} -P {1} -E -H {2} sdr type temperature".format(username, password, hostaddr)

    proxyaddr = config['proxy']['ip']
    proxyusername = config['proxy']['user']

    result = ssh("{0}@{1}".format(proxyusername, proxyaddr), command)

    return result

print get_ipmi_temperature(hostname)
{'fraction_non_alphanumeric': 0.12960893854748604, 'fraction_numerical': 0.010614525139664804, 'mean_word_length': 5.010067114093959, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '961508', 'n_tokens_mistral': 581, 'n_tokens_neox': 555, 'n_words': 138}