make dos linefeeds go away master
Scott Baker [Fri, 20 Mar 2015 21:50:39 +0000 (14:50 -0700)]
opencloud-net/opencloud-net-watcher.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 3a0cfcb..a99edf6
@@ -1,3 +1,5 @@
+#!/usr/bin/python
+
 """
     Poll neutron for changes in ports. Run opencloud-net if a change is
     detected.
@@ -122,23 +124,23 @@ class OpenCloudNetWatcher:
             time.sleep(30)
 
     # after http://www.erlenstar.demon.co.uk/unix/faq_2.html
-    def daemon(self):\r
-        """Daemonize the current process."""\r
-        if os.fork() != 0: os._exit(0)\r
-        os.setsid()\r
-        if os.fork() != 0: os._exit(0)\r
-        os.chdir('/')\r
-        os.umask(0022)\r
-        devnull = os.open(os.devnull, os.O_RDWR)\r
-        os.dup2(devnull, 0)\r
-        # xxx fixme - this is just to make sure that nothing gets stupidly lost - should use devnull\r
-        crashlog = os.open('/var/log/opencloud-net-watcher.daemon', os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)\r
-        os.dup2(crashlog, 1)\r
+    def daemon(self):
+        """Daemonize the current process."""
+        if os.fork() != 0: os._exit(0)
+        os.setsid()
+        if os.fork() != 0: os._exit(0)
+        os.chdir('/')
+        os.umask(0022)
+        devnull = os.open(os.devnull, os.O_RDWR)
+        os.dup2(devnull, 0)
+        # xxx fixme - this is just to make sure that nothing gets stupidly lost - should use devnull
+        crashlog = os.open('/var/log/opencloud-net-watcher.daemon', os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)
+        os.dup2(crashlog, 1)
         os.dup2(crashlog, 2)
 
 def main():
     parser = optparse.OptionParser()
-    parser.add_option('-d', '--daemon', action='store_true', dest='daemon', default=False,\r
+    parser.add_option('-d', '--daemon', action='store_true', dest='daemon', default=False,
                       help='run daemonized')
     parser.add_option('-l', '--logfile', action='store', dest='logfile', default="/var/log/opencloud-net-watcher",
                   help='log file name')
@@ -146,7 +148,7 @@ def main():
     (options, args) = parser.parse_args()
 
     logging.basicConfig(filename=options.logfile,level=logging.INFO)
-\r
+
     watcher = OpenCloudNetWatcher(daemonize = options.daemon)
     watcher.run_loop()