Esempio n. 1
0
        + " up, "
        + str(down_count)
        + " down?, "
        + str(slack_count)
        + " slack)<br />"
    )
    html += (
        str(job_assigned)
        + " exe resources ("
        + str(job_assigned_cpus)
        + """ cpu's) appear to be executing a job<br />
<br />
"""
    )
    html += "<!-- begin raw footer: this line is used by showvgridmonitor -->"
    html += get_cgi_html_footer(configuration, "")

    try:
        file_handle = open(html_file, "w")
        file_handle.write(html)
        file_handle.close()
    except Exception, exc:
        print "Could not write monitor page %s: %s" % (html_file, exc)


while True:
    (status, vgrids_list) = vgrid_list_vgrids(configuration)

    # create global statistics ("")
    # vgrids_list.append("")
Esempio n. 2
0
configuration = get_configuration_object()
logger = configuration.logger
logger.info('Resource list GUI: start')

print '''Content-type: text/html

'''

form = cgi.FieldStorage()

print get_cgi_html_header(configuration, 'Grid Resource administration',
                          'Welcome to the Grid resource administration.')

dir_list = os.listdir(configuration.resource_home)
for file in dir_list:
    hosturl = file[0:file.rindex('.')]
    hostidentifier = file[file.rindex('.') + 1:]
    print "     <a href='resource_edit.py?hosturl=" + hosturl\
         + '&hostidentifier=' + hostidentifier\
         + "'>edit</a>&nbsp;&nbsp;<b>" + file + '</b><br />'

print """	<hr>
	    <form action="./resource_edit.py" method="post">
	    <input type="hidden" name="new_resource" value="true" />
	    <input type="submit" name="New" value="New" />
	    </form>
	    """
print get_cgi_html_footer(configuration, '')

Esempio n. 3
0
""" % published_id
        for (meta_key, meta_label) in public_meta:
            meta_value = freeze_dict.get(meta_key, '')
            if meta_value:
                contents += """%s: %s<br/>
""" % (meta_label, meta_value)
        contents += """
<h2 class='staticpage'>Archive Files</h2>
        """
        for rel_path in frozen_files:
            contents += """<a href='%s'>%s</a><br/>
""" % (rel_path, rel_path)
        contents += """
</div>
%s
        """ % get_cgi_html_footer(configuration, widgets=False)
        if not make_symlink(frozen_dir, real_pub_dir, logger) or \
               not write_file(contents, real_pub_index, configuration.logger):
            logger.error("create_frozen_archive: publish failed")
            remove_rec(frozen_dir, configuration)
            return (False, 'Error publishing frozen archive')
    return (True, freeze_id)

def delete_frozen_archive(freeze_id, configuration):
    """Delete an existing frozen archive without checking ownership or
    persistance of frozen archives.
    """
    frozen_dir = os.path.join(configuration.freeze_home, freeze_id)
    if remove_rec(frozen_dir, configuration):
        return (True, '')
    else: