Exemple #1
0
def display_acs_version(option, opt_str, value, parser):
    """
    :param option:
    :param opt_str:
    :param value:
    :param parser:
    :return:
    """
    print "ACS " + Util.get_acs_release_version()
    sys.exit(0)
Exemple #2
0
    def _init_bench_info_node(self):
        """
        Initialize the DeviceInfo Node with theses values:

        DeviceInfo:
            - Bench Name (hostname)
            - Bench user
            - Bench IP
            - Bench OS
            - ACS Version (host)

        :rtype: None
        """

        # Create the <BenchInfo> element
        self.bench_info = etree.SubElement(self.document, "BenchInfo")

        # Create the <BenchName> node for hostInfo
        bench_name = etree.SubElement(self.bench_info, "BenchName")
        # Set BenchName value
        bench_name.text = clean_xml_text(self.__get_bench_name())

        # Create the <BenchUser> node for hostInfo
        bench_user = etree.SubElement(self.bench_info, "BenchUser")
        # Set BenchUser value
        bench_user.text = clean_xml_text(self.__get_bench_user())

        # Create the <BenchIp> node for hostInfo
        bench_ip = etree.SubElement(self.bench_info, "BenchIp")
        # Set BenchIp value
        bench_ip.text = self.__get_bench_ip()

        # Create the <BenchOs> node for hostInfo
        bench_os = etree.SubElement(self.bench_info, "BenchOs")
        # Set BenchName value
        bench_os.text = self.__get_bench_os()

        # Create the <AcsVersion> node for hostInfo
        acs_version = etree.SubElement(self.bench_info, "AcsVersion")
        # Set AcsVersion value
        acs_version.text = Util.get_acs_release_version()