Ejemplo n.º 1
0
    def mgmt_identify_args(self):
        args = {}
        try:
            # prefer actual license, then test (demo) license, then anonymous
            ui_root = helpers.get_ui_config()
            if ui_root.hasS(ns_ui.licenseKey) and ui_root.getS(ns_ui.licenseKey, rdf.String) != "":
                args["licenseKey"] = ui_root.getS(ns_ui.licenseKey, rdf.String)
            elif ui_root.hasS(ns_ui.testLicenseKey) and ui_root.getS(ns_ui.testLicenseKey, rdf.String) != "":
                args["licenseKey"] = ui_root.getS(ns_ui.testLicenseKey, rdf.String)
            else:
                raise Exception("no configured license")
        except:
            args["licenseKey"] = ""  # anonymous

        try:
            t = helpers.get_boot_uuid()
            if t is None:
                args["bootUuid"] = ""
            else:
                args["bootUuid"] = t
        except:
            args["bootUuid"] = ""

        try:
            t = helpers.get_installation_uuid()
            if t is None:
                args["installationUuid"] = ""
            else:
                args["installationUuid"] = t
        except:
            args["installationUuid"] = ""

        try:
            t = helpers.get_cookie_uuid()
            if t is None:
                args["cookieUuid"] = ""
            else:
                args["cookieUuid"] = t
        except:
            args["cookieUuid"] = ""

        args["address"] = "0.0.0.0"  # XXX: overwritten
        args["port"] = 0  # XXX: overwritten

        try:
            args["softwareVersion"] = helpers.get_product_version()
        except:
            args["softwareVersion"] = ""

        args["softwareBuildInfo"] = ""  # XXX
        args["hardwareType"] = ""  # XXX
        args["hardwareInfo"] = ""  # XXX

        try:
            args["automaticUpdates"] = helpers.get_ui_config().getS(ns_ui.automaticUpdates, rdf.Boolean)
        except:
            args["automaticUpdates"] = True

        try:
            args["isLiveCd"] = helpers.is_live_cd()
        except:
            args["isLiveCd"] = False

        return args
Ejemplo n.º 2
0
    def _do_mgmt_identify_args(self):
        root = self.rdf_root
        licinfo = self.rdf_root.getS(ns_ui.licenseInfo,
                                     rdf.Type(ns_ui.LicenseInfo))
        uiconfig = self.rdf_root.getS(ns_ui.uiConfig, rdf.Type(ns_ui.UiConfig))

        args = {}
        try:
            ui_root = helpers.get_ui_config()
            if ui_root.hasS(ns_ui.licenseKey) and ui_root.getS(
                    ns_ui.licenseKey, rdf.String) != '':
                args['licenseKey'] = ui_root.getS(ns_ui.licenseKey, rdf.String)
            elif ui_root.hasS(ns_ui.testLicenseKey) and ui_root.getS(
                    ns_ui.testLicenseKey, rdf.String) != '':
                args['licenseKey'] = ui_root.getS(ns_ui.testLicenseKey,
                                                  rdf.String)
            else:
                raise Exception('no configured license')
        except:
            args['licenseKey'] = ''  # anonymous

        try:
            t = helpers.get_boot_uuid()
            if t is None:
                args['bootUuid'] = ''
            else:
                args['bootUuid'] = t
        except:
            args['bootUuid'] = ''

        try:
            t = helpers.get_installation_uuid()
            if t is None:
                args['installationUuid'] = ''
            else:
                args['installationUuid'] = t
        except:
            args['installationUuid'] = ''

        try:
            t = helpers.get_cookie_uuid()
            if t is None:
                args['cookieUuid'] = ''
            else:
                args['cookieUuid'] = t
        except:
            args['cookieUuid'] = ''

        args['address'] = '0.0.0.0'  # overridden by managementconnection
        args['port'] = 0  # overridden by managementconnection

        try:
            args['softwareVersion'] = helpers.get_product_version()
        except:
            args['softwareVersion'] = ''

        args['softwareBuildInfo'] = ''  # XXX
        args['hardwareType'] = ''  # XXX
        args['hardwareInfo'] = ''  # XXX

        try:
            if self.force_update:
                args['automaticUpdates'] = True
            else:
                args['automaticUpdates'] = uiconfig.getS(
                    ns_ui.automaticUpdates, rdf.Boolean)
        except:
            args['automaticUpdates'] = True

        try:
            args['isLiveCd'] = helpers.is_live_cd()
        except:
            args['isLiveCd'] = False

        return args
Ejemplo n.º 3
0
    def _do_mgmt_identify_args(self):
        root = self.rdf_root
        licinfo = self.rdf_root.getS(ns_ui.licenseInfo, rdf.Type(ns_ui.LicenseInfo))
        uiconfig = self.rdf_root.getS(ns_ui.uiConfig, rdf.Type(ns_ui.UiConfig))
        
        args = {}
        try:
            ui_root = helpers.get_ui_config()
            if ui_root.hasS(ns_ui.licenseKey) and ui_root.getS(ns_ui.licenseKey, rdf.String) != '':
                args['licenseKey'] = ui_root.getS(ns_ui.licenseKey, rdf.String)
            elif ui_root.hasS(ns_ui.testLicenseKey) and ui_root.getS(ns_ui.testLicenseKey, rdf.String) != '':
                args['licenseKey'] = ui_root.getS(ns_ui.testLicenseKey, rdf.String)
            else:
                raise Exception('no configured license')
        except:
            args['licenseKey'] = ''  # anonymous

        try:
            t = helpers.get_boot_uuid()
            if t is None:
                args['bootUuid'] = ''
            else:
                args['bootUuid'] = t
        except:
            args['bootUuid'] = ''
        
        try:
            t = helpers.get_installation_uuid()
            if t is None:
                args['installationUuid'] = ''
            else:
                args['installationUuid'] = t
        except:
            args['installationUuid'] = ''

        try:
            t = helpers.get_cookie_uuid()
            if t is None:
                args['cookieUuid'] = ''
            else:
                args['cookieUuid'] = t
        except:
            args['cookieUuid'] = ''

        args['address'] = '0.0.0.0'       # overridden by managementconnection
        args['port'] = 0                  # overridden by managementconnection

        try:
            args['softwareVersion'] = helpers.get_product_version()
        except:
            args['softwareVersion'] = ''

        args['softwareBuildInfo'] = ''    # XXX
        args['hardwareType'] = ''         # XXX
        args['hardwareInfo'] = ''         # XXX

        try:
            if self.force_update:
                args['automaticUpdates'] = True
            else:
                args['automaticUpdates'] = uiconfig.getS(ns_ui.automaticUpdates, rdf.Boolean)
        except:
            args['automaticUpdates'] = True

        try:
            args['isLiveCd'] = helpers.is_live_cd()
        except:
            args['isLiveCd'] = False

        return args