diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-01-13 20:00:16 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-01-13 20:00:16 +0000 |
commit | 5b8fd8cb103f31ef0d67c0fd4bbedfec0988c6af (patch) | |
tree | 42156b849284060c18d5e19b893473b4375dca7a /src/lib/Server/Reports | |
parent | 95e0e4207468efc253aabe0d36dfb816aac59653 (diff) | |
download | bcfg2-5b8fd8cb103f31ef0d67c0fd4bbedfec0988c6af.tar.gz bcfg2-5b8fd8cb103f31ef0d67c0fd4bbedfec0988c6af.tar.bz2 bcfg2-5b8fd8cb103f31ef0d67c0fd4bbedfec0988c6af.zip |
Add support for alternate VCS backends
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5023 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Reports')
-rwxr-xr-x | src/lib/Server/Reports/importscript.py | 16 | ||||
-rw-r--r-- | src/lib/Server/Reports/reports/fixtures/initial_version.xml | 4 | ||||
-rw-r--r-- | src/lib/Server/Reports/reports/models_new.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Reports/reports/models_old.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Reports/reports/templates/clients/client-nodebox.html | 2 | ||||
-rw-r--r-- | src/lib/Server/Reports/updatefix.py | 4 |
6 files changed, 18 insertions, 12 deletions
diff --git a/src/lib/Server/Reports/importscript.py b/src/lib/Server/Reports/importscript.py index 763056c20..bb26647f2 100755 --- a/src/lib/Server/Reports/importscript.py +++ b/src/lib/Server/Reports/importscript.py @@ -1,6 +1,6 @@ #! /usr/bin/env python '''Imports statistics.xml and clients.xml files in to database backend for new statistics engine''' -__revision__ = '$Revision$' +__revision__ = '$Revision: 4999 $' import os, sys, binascii try: @@ -98,13 +98,13 @@ def load_stats(cdata, sdata, vlevel, quick=False, location=''): continue else: newint = Interaction(client=c_inst, - timestamp=timestamp, - state=statistics.get('state', default="unknown"), - repo_revision=statistics.get('revision',default="unknown"), - client_version=statistics.get('client_version',default="unknown"), - goodcount=statistics.get('good',default="0"), - totalcount=statistics.get('total',default="0"), - server=location) + timestamp = timestamp, + state = statistics.get('state', default="unknown"), + repo_rev_code = statistics.get('revision',default="unknown"), + client_version = statistics.get('client_version',default="unknown"), + goodcount = statistics.get('good',default="0"), + totalcount = statistics.get('total',default="0"), + server = location) newint.save() current_interaction = newint if vlevel > 0: diff --git a/src/lib/Server/Reports/reports/fixtures/initial_version.xml b/src/lib/Server/Reports/reports/fixtures/initial_version.xml index 9edb8fe57..4fc05b7af 100644 --- a/src/lib/Server/Reports/reports/fixtures/initial_version.xml +++ b/src/lib/Server/Reports/reports/fixtures/initial_version.xml @@ -20,4 +20,8 @@ <field type='IntegerField' name='version'>10</field> <field type='DateTimeField' name='updated'>2008-08-22 11:28:50</field> </object> + <object pk="5" model="reports.internaldatabaseversion"> + <field type='IntegerField' name='version'>11</field> + <field type='DateTimeField' name='updated'>2009-01-13 12:26:10</field> + </object> </django-objects> diff --git a/src/lib/Server/Reports/reports/models_new.py b/src/lib/Server/Reports/reports/models_new.py index 3b1a005da..c8f649089 100644 --- a/src/lib/Server/Reports/reports/models_new.py +++ b/src/lib/Server/Reports/reports/models_new.py @@ -111,7 +111,7 @@ class Interaction(models.Model): client = models.ForeignKey(Client, related_name="interactions",) timestamp = models.DateTimeField()#Timestamp for this record state = models.CharField(max_length=32)#good/bad/modified/etc - repo_revision = models.IntegerField()#repo revision at time of interaction + repo_rev_code = models.CharField(max_length=64)#repo revision at time of interaction client_version = models.CharField(max_length=32)#Client Version goodcount = models.IntegerField()#of good config-items totalcount = models.IntegerField()#of total config-items diff --git a/src/lib/Server/Reports/reports/models_old.py b/src/lib/Server/Reports/reports/models_old.py index a45fb0d30..aee66fd7d 100644 --- a/src/lib/Server/Reports/reports/models_old.py +++ b/src/lib/Server/Reports/reports/models_old.py @@ -111,7 +111,7 @@ class Interaction(models.Model): client = models.ForeignKey(Client, related_name="interactions", core=True) timestamp = models.DateTimeField()#Timestamp for this record state = models.CharField(maxlength=32)#good/bad/modified/etc - repo_revision = models.IntegerField()#repo revision at time of interaction + repo_rev_code = models.CharField(maxlength=64)#repo revision at time of interaction client_version = models.CharField(maxlength=32)#Client Version goodcount = models.IntegerField()#of good config-items totalcount = models.IntegerField()#of total config-items diff --git a/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html b/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html index daa8bb245..5aae03c30 100644 --- a/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html +++ b/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html @@ -9,7 +9,7 @@ <tr><td width="43%"><h2>Node: <span class="nodename"> <a href="{% url Bcfg2.Server.Reports.reports.views.client_detail client.name,pk=i.id %}">{{client.name}}</a></span></h2></td> <td width="23%"> - {% if interaction.repo_revision %}Revision: {{interaction.repo_revision}}{% endif %} + {% if interaction.repo_rev_code %}Revision: {{interaction.repo_rev_code}}{% endif %} </td> <td width="33%"><div class="statusborder"> <div class="greenbar" style="width: {{interaction.percentgood}}%;"> </div> diff --git a/src/lib/Server/Reports/updatefix.py b/src/lib/Server/Reports/updatefix.py index f3679892e..4a35c31ea 100644 --- a/src/lib/Server/Reports/updatefix.py +++ b/src/lib/Server/Reports/updatefix.py @@ -60,6 +60,8 @@ _fixes = [_merge_database_table_entries, "drop table reports_repository;", "drop table reports_metadata;", "alter table reports_interaction add server varchar(256) not null default 'N/A';", + # fix revision data type to support $VCS hashes + "alter table reports_interaction add repo_rev_code varchar(64) default '';", ] # this will calculate the last possible version of the database @@ -95,7 +97,7 @@ def dosync(): # if we get here with no error then the database has existing tables fresh = False except: - logger.debug("there was an error while detecting the freshnest of the database") + logger.debug("there was an error while detecting the freshness of the database") #we should get here if the database is new fresh = True |