コード例 #1
0
ファイル: fabfile.py プロジェクト: futuregrid/flask_cm
def activate():
    settingsFilePath = config.get('azure', 'publishsettings_file_path')
    _azure('account', 'clear')
    errmsg = 'No account information found'
    cmd = 'azure account import \'' + settingsFilePath+'\''

    text = commands.getstatusoutput(cmd)
    if not errmsg in text[1]:
        print 'Activated'
    else:
        print 'There was an error while activation'
コード例 #2
0
def activate():
    settingsFilePath = config.get('cloudmesh.azurepublishsettings_file_path')
    _azure('account', 'clear')
    errmsg = 'No account information found'
    cmd = 'azure account import \'' + settingsFilePath + '\''

    text = commands.getstatusoutput(cmd)
    if not errmsg in text[1]:
        print 'Activated'
    else:
        print 'There was an error while activation'
コード例 #3
0
ファイル: fabfile.py プロジェクト: jeff-ridgeway/cloudmesh
def activate():
    settingsFilePath = config.get("cloudmesh.azurepublishsettings_file_path")
    _azure("account", "clear")
    errmsg = "No account information found"
    cmd = "azure account import '" + settingsFilePath + "'"

    text = commands.getstatusoutput(cmd)
    if not errmsg in text[1]:
        print "Activated"
    else:
        print "There was an error while activation"
コード例 #4
0
ファイル: fabfile.py プロジェクト: futuregrid/flask_cm
def _buildAzureImageDict():
    allText = _azure('vm', 'image', 'list')
    imageNamePrefix = 'azure_img'
    imageNameCounter = 0
    allLines = allText.splitlines()
    cleanLines = []
    counter = 2
    images = {}
    # skip counter number of lines
    for line in allLines:
        if 'data' in line:
            if not counter:
                cleanLines.append(line)
            else:
                counter = counter - 1

    for line in cleanLines:
        imageNameCounter = imageNameCounter+1
        l = []
        #(name, id, os) = line.split()
        # l.append(name)
        # l.append(id)
        # l.append(os)

        l.append(line.split()[1])
        l.append(line.split()[2])
        l.append(line.split()[3])
        images[imageNamePrefix+str(imageNameCounter)] = l

    return images
コード例 #5
0
def _buildAzureImageDict():
    allText = _azure('vm', 'image', 'list')
    imageNamePrefix = 'azure_img'
    imageNameCounter = 0
    allLines = allText.splitlines()
    cleanLines = []
    counter = 2
    images = {}
    # skip counter number of lines
    for line in allLines:
        if 'data' in line:
            if not counter:
                cleanLines.append(line)
            else:
                counter = counter - 1

    for line in cleanLines:
        imageNameCounter = imageNameCounter + 1
        l = []
        # (name, id, os) = line.split()
        # l.append(name)
        # l.append(id)
        # l.append(os)

        l.append(line.split()[1])
        l.append(line.split()[2])
        l.append(line.split()[3])
        images[imageNamePrefix + str(imageNameCounter)] = l

    return images
コード例 #6
0
ファイル: cm_azure.py プロジェクト: lee212/flask_cm
    def _buildAzureImageDict(self) :
        lines = _azure('vm','image','list').splitlines()

        imageNamePrefix = 'azure_img'
        imageNameCounter =0;

        counter = 0;
        images={};

        lines = lines[2:-1]  # is this right or just [2:]

        for line in lines :
            counter = counter+1
            l=[];
            #(name, id, os) = line.split()
            #l.append(name)
            #l.append(id)
            #l.append(os)

            l.append(line.split()[1])
            l.append(line.split()[2])
            l.append(line.split()[3])

            # this is not correct as image name is in sttructure, but this is a label you define

            images[imageNamePrefix+str(counter)]=l

        return images