commit 737b0e285b73a5b82b7fa479f5b1ff043f4dcb55
Author: Vangelis Koukis <vkoukis@grnet.gr>
Date:   Fri Jul 22 12:28:31 2011 +0300

    Add license text to snf-ganeti-eventd and hooks

diff --git a/ganeti/hooks.py b/ganeti/hooks.py
index 5374de3..271b9cf 100644
--- a/ganeti/hooks.py
+++ b/ganeti/hooks.py
@@ -1,6 +1,39 @@
 #!/usr/bin/env python
 #
-# Copyright (c) 2010 Greek Research and Technology Network
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 GRNET S.A. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+#
+#   1. Redistributions of source code must retain the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer.
+#
+#   2. Redistributions in binary form must reproduce the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer in the documentation and/or other materials
+#      provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and
+# documentation are those of the authors and should not be
+# interpreted as representing official policies, either expressed
+# or implied, of GRNET S.A.
 #
 """Ganeti hooks for Synnefo
 
@@ -23,7 +56,7 @@ import synnefo.settings as settings
 
 def ganeti_net_status(logger, environ):
     """Produce notifications of type 'Ganeti-net-status'
-    
+
     Process all GANETI_INSTANCE_NICx_y environment variables,
     where x is the NIC index, starting at 0,
     and y is one of "MAC", "IP", "BRIDGE".
@@ -177,7 +210,7 @@ class PostStartHook(GanetiHook):
         if self.on_master():
             notifs = []
             notifs.append(("net", ganeti_net_status(self.logger, self.environ)))
-            
+
             self.publish_msgs(notifs)
 
         return 0
diff --git a/ganeti/snf-ganeti-eventd.py b/ganeti/snf-ganeti-eventd.py
index 5aac274..7d0131a 100755
--- a/ganeti/snf-ganeti-eventd.py
+++ b/ganeti/snf-ganeti-eventd.py
@@ -1,8 +1,41 @@
 #!/usr/bin/env python
 #
-# Copyright (c) 2010 Greek Research and Technology Network
+# -*- coding: utf-8 -*-
 #
-"""Ganeti notification daemon with AMQP
+# Copyright 2011 GRNET S.A. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+#
+#   1. Redistributions of source code must retain the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer.
+#
+#   2. Redistributions in binary form must reproduce the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer in the documentation and/or other materials
+#      provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and
+# documentation are those of the authors and should not be
+# interpreted as representing official policies, either expressed
+# or implied, of GRNET S.A.
+#
+"""Ganeti notification daemon with AMQP support
 
 A daemon to monitor the Ganeti job queue and publish job progress
 and Ganeti VM state notifications to the ganeti exchange
@@ -39,7 +72,7 @@ class JobFileHandler(pyinotify.ProcessEvent):
     def __init__(self, logger):
         pyinotify.ProcessEvent.__init__(self)
         self.logger = logger
-        self.chan = None 
+        self.chan = None
 
     def open_channel(self):
         conn = None
@@ -53,7 +86,7 @@ class JobFileHandler(pyinotify.ProcessEvent):
                      virtual_host=settings.RABBIT_VHOST)
             except socket.error:
                 time.sleep(1)
-        
+
         handler_logger.info("Connection succesful, opening channel")
         return conn.channel()
 
@@ -109,10 +142,10 @@ class JobFileHandler(pyinotify.ProcessEvent):
                     }
             if logmsg:
                 msg["message"] = logmsg
-            
-            instance = instances.split('-')[0]  
+
+            instance = instances.split('-')[0]
             routekey = "ganeti.%s.event.op" % instance
-            
+
             self.logger.debug("Delivering msg: %s (key=%s)",
                 json.dumps(msg), routekey)
             msg = amqp.Message(json.dumps(msg))
diff --git a/ganeti/snf-ganeti-hook.py b/ganeti/snf-ganeti-hook.py
index 89d69e8..6792d3e 100755
--- a/ganeti/snf-ganeti-hook.py
+++ b/ganeti/snf-ganeti-hook.py
@@ -1,6 +1,39 @@
 #!/usr/bin/env python
 #
-# Copyright (c) 2010 Greek Research and Technology Network
+# -*- coding: utf-8 -*-
+#
+# Copyright 2011 GRNET S.A. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+#
+#   1. Redistributions of source code must retain the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer.
+#
+#   2. Redistributions in binary form must reproduce the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer in the documentation and/or other materials
+#      provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and
+# documentation are those of the authors and should not be
+# interpreted as representing official policies, either expressed
+# or implied, of GRNET S.A.
 #
 """Ganeti hook for Synnefo
 
@@ -30,7 +63,7 @@ except ImportError:
 # "instance-stop", "instance-reboot", "instance-modify". See the Ganeti
 # documentation for a full list.
 
-# The operation and phase for which the hook run are determined from the 
+# The operation and phase for which the hook run are determined from the
 # values of the GANETI_HOOK_PATH and GANETI_HOOK_PHASE environment variables.
 # For each valid (operation, phase) pair control passes to the corresponding
 # Python function, based on the following dictionary.
@@ -57,9 +90,9 @@ def main():
     except KeyError:
         raise Exception("Environment missing one of: " \
             "GANETI_INSTANCE_NAME, GANETI_HOOKS_PATH, GANETI_HOOKS_PHASE")
-        
+
     prefix = instance.split('-')[0]
-  
+
     # FIXME: The hooks should only run for Synnefo instances.
     # Uncomment the following lines for a shared Ganeti deployment.
     # Currently, the following code is commented out because multiple
