enable monitor in plc-config
authorStephen Soltesz <soltesz@cs.princeton.edu>
Tue, 16 Jun 2009 20:35:34 +0000 (20:35 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Tue, 16 Jun 2009 20:35:34 +0000 (20:35 +0000)
add easy_install packages to update critical packages for monitor
auto-close a ticket whose status was changed in RT

Monitor.spec
monitor/database/info/action.py
monitor/database/info/interface.py

index af4111f..5ac70fe 100644 (file)
@@ -211,12 +211,17 @@ rm -rf $RPM_BUILD_ROOT
 /%{_initrddir}/monitor-runlevelagent
 
 %post server-deps
-#easy_install --build-directory /var/tmp -UZ Elixir
 #easy_install --build-directory /var/tmp -UZ ElementTree
-## TODO: something is bad wrong with this approach.
 ##easy_install --build-directory /var/tmp -UZ http://pypi.python.org/packages/2.5/E/Extremes/Extremes-1.1-py2.5.egg
-#easy_install --build-directory /var/tmp -UZ http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.5.3.tar.gz
-#easy_install --build-directory /var/tmp -UZ http://files.turbogears.org/eggs/TurboGears-1.0.7-py2.5.egg
+
+# NOTE: enable monitor by default, since we're installing it.
+plc-config --save /etc/planetlab/default_config.xml \
+                       --category plc_monitor --variable enabled --value true
+
+## TODO: something is bad wrong with this approach.
+easy_install --build-directory /var/tmp -UZ http://files.turbogears.org/eggs/TurboGears-1.0.7-py2.5.egg
+easy_install --build-directory /var/tmp -UZ http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.5.3.tar.gz
+easy_install --build-directory /var/tmp -UZ Elixir
 
 # crazy openssl libs for racadm binary
 ln -s /lib/libssl.so.0.9.8b /usr/lib/libssl.so.2
index 0abec62..ab55ed0 100644 (file)
@@ -83,7 +83,7 @@ class ActionRecord(Entity):
                # TODO: need to sort on 'round' since actions will not be globally sync'd.
                return cls.query.filter_by(**kwargs).order_by(ActionRecord.id.desc()).first()
 
-# ACCOUNTING
+       # ACCOUNTING
        date_created = Field(DateTime,default=datetime.now)
        loginbase = Field(String,default=None)
        hostname = Field(String,default=None)
index c0ffbf3..0692ede 100644 (file)
@@ -127,6 +127,8 @@ class SiteInterface(HistorySiteRecord):
 
                        if viart:
                                self.getTicketStatus()          # get current message status
+                               if self.db.message_status not in ['open', 'new']:
+                                       self.closeTicket()
 
                        m = Message(message[0] % args, message[1] % args, viart, self.db.message_id)