Revision 10 -
(download)
(as text)
(annotate)
Fri Aug 31 10:40:38 2012 UTC
(11 years, 9 months ago)
by agomez File size: 1231 byte(s)
Corrected minor error in license text
Powerpoint presentation to show how to use the software (also in PDF).
#
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit
#
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012
#
# License GPL Version 3
#
# The research leading to these results has received funding from
# the European Community's Seventh Framework Programme (FP7/2007-2013)
# under agreement number 257386
#
# This software is provided with ABSOLUTELY NO WARRANTY
#
import os
def getpass(file):
filepath=os.path.expanduser(file)
password=None
try:
f=open(filepath,'r')
for line in f.readlines():
if line.find('password') == 0 :
password=line.split()[1]
except IOError:
print 'ERROR: You must include your credentials in ' + file
exit()
if password == None:
print 'ERROR: You must include your password in ' + file
exit()
return password
def getuser(file):
user=None
filepath=os.path.expanduser(file)
try:
f=open(filepath,'r')
for line in f.readlines():
if line.find('user') == 0 :
user=line.split()[1]
except IOError:
print 'ERROR: You must include your credentials in ' + file
exit()
if user == None:
print 'ERROR: You must include your username in ' + file
exit()
return user