Ejemplo n.º 1
0
 def _load_projects(self):
     if not self.cm_shell_project_loaded:
         filename = config_file("/cloudmesh.yaml")
         self.projects = cm_projects(filename)
         if self.echo:
             log.info(
                 "Reading project information from -> {0}".format(filename))
         self.cm_shell_project_loaded = True
Ejemplo n.º 2
0
 def activate_shell_project(self):
     self.register_command_topic('cloud', 'project')
     #
     # BUG this should be done outside of the activate
     #
     filename = "$HOME/.futuregrid/cloudmesh.yaml"
     self.projects = cm_projects(filename)
     if self.echo:
         log.info(
             "Reading project information from -> {0}".format(filename))
     pass
Ejemplo n.º 3
0
 def activate_shell_project(self):
     self.register_command_topic('cloud','project')
     #
     # BUG this should be done outside of the activate
     #
     filename = "$HOME/.futuregrid/cloudmesh.yaml"
     self.projects = cm_projects(filename)
     if self.echo:
         log.info(
             "Reading project information from -> {0}".format(filename))
     pass
Ejemplo n.º 4
0
def profile():
    # bug the global var of the ditc should be used

    config = cm_config()
    configuration = config.get()
    projects = cm_projects()
    person = configuration['profile']
    keys = cm_keys()
    version = "tmp"

    if request.method == 'POST':
        print request.form
        print "p", projects
        # print "c", config
        projects.default = request.form['field-selected-project']
        configuration['security']['default'] = request.form[
            'field-selected-securityGroup']
        config.index = request.form['field-index']
        config.prefix = request.form['field-prefix']
        config.firstname = request.form['field-firstname']
        config.lastname = request.form['field-lastname']
        config.phone = request.form['field-phone']
        config.email = request.form['field-email']

        print "setting the values"
        config.default_cloud = request.form['field-default-cloud']
        # print request.form["field-cloud-activated-" + value]
        print "setting the cloud values"
        # print config
        config.write()
        print "WRITING DONE"

    time_now = datetime.now().strftime("%Y-%m-%d %H:%M")

    address = '<br>'.join(str(x) for x in person['address'])
    return render_template('profile.html',
                           updated=time_now,
                           keys=keys,
                           projects=projects,
                           person=person,
                           address=address,
                           # clouds=clouds,
                           config=config,
                           configuration=configuration,
                           version=version,
                           )
Ejemplo n.º 5
0
 def test00_wrong_file(self):
     HEADING("00 WRONG FILE")
     try:
         self.projects = cm_projects("wrong file")
     except:
         pass
Ejemplo n.º 6
0
 def setup(self):
     self.projects = cm_projects(self.filename)
Ejemplo n.º 7
0
 def test00_wrong_file(self):
     HEADING()
     try:
         self.projects = cm_projects("wrong file")
     except:
         pass
Ejemplo n.º 8
0
 def setup(self):
     self.projects = cm_projects(self.filename)