Ejemplo n.º 1
0
    def get_platform_id(self):
        plat_name = platform.system() + ' ' + platform.release()

        plats = Rest.list_platform()
        if plats is not None and len(plats) > 0:
            for p in plats:
                if p['name'] == plat_name:
                    return p['id']

        new_platform = Rest.create_platform(plat_name)
        return new_platform['id']
Ejemplo n.º 2
0
    def get_platform_id(self):
        plat_name = platform.system() + ' ' + platform.release()
        plat_name = platform.system()
        plats = Rest.list_platform()
        if plats is not None and len(plats) > 0:
            for p in plats:
                if p['name'] == plat_name:
                    return p['id']
        
        new_platform = Rest.create_platform(plat_name)

        """
        plat_shortname = platform.system()
        if plats is not None and len(plats) > 0:
            found = False
            for p in plats:
                if p['name'] == plat_shortname:
                    found = True
                    break
            if found == False:
                Rest.create_platform(plat_shortname)
        """

        return new_platform['id']