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'
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'
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"
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
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
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