~ubuntu-branches/ubuntu/saucy/walinuxagent/saucy

« back to all changes in this revision

Viewing changes to debian/patches/000_no_udev_rule_removal.patch

  • Committer: Scott Moser
  • Author(s): Ben Howard
  • Date: 2013-06-11 19:09:58 UTC
  • Revision ID: smoser@ubuntu.com-20130611190958-czekjpmmaa7g67v1
Tags: 1.3.2-0ubuntu2
Added logic to prevent udev rules.d movement (LP: #1188753)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/waagent
 
2
+++ b/waagent
 
3
@@ -701,12 +701,13 @@ class EnvMonitor(object):
 
4
             dhcpcmd = "pidof dhclient3"
 
5
         dhcppid = RunGetOutput(dhcpcmd,chk_err=False)[1]
 
6
         while not self.shutdown:
 
7
-            for a in RulesFiles:
 
8
-                if os.path.isfile(a):
 
9
-                    if os.path.isfile(GetLastPathElement(a)):
 
10
-                        os.remove(GetLastPathElement(a))
 
11
-                    shutil.move(a, ".")
 
12
-                    Log("EnvMonitor: Moved " + a + " -> " + LibDir)
 
13
+            if not IsDebian():
 
14
+                for a in RulesFiles:
 
15
+                    if os.path.isfile(a):
 
16
+                        if os.path.isfile(GetLastPathElement(a)):
 
17
+                            os.remove(GetLastPathElement(a))
 
18
+                        shutil.move(a, ".")
 
19
+                        Log("EnvMonitor: Moved " + a + " -> " + LibDir)
 
20
             if publish != None and publish.lower().startswith("y"):
 
21
                 try:
 
22
                     if socket.gethostname() != self.HostName:
 
23
@@ -2318,12 +2319,13 @@ def Install():
 
24
     if UsesDpkg() and not Run("dpkg-query -s network-manager >/dev/null 2>&1",chk_err=False):  # We want this to fail - supress error logging on error.
 
25
         Error(GuestAgentLongName + " is not compatible with network-manager.")
 
26
         return 1
 
27
-    for a in RulesFiles:
 
28
-        if os.path.isfile(a):
 
29
-            if os.path.isfile(GetLastPathElement(a)):
 
30
-                os.remove(GetLastPathElement(a))
 
31
-            shutil.move(a, ".")
 
32
-            Warn("Moved " + a + " -> " + LibDir + "/" + GetLastPathElement(a) )
 
33
+    if not IsDebian():
 
34
+        for a in RulesFiles:
 
35
+            if os.path.isfile(a):
 
36
+                if os.path.isfile(GetLastPathElement(a)):
 
37
+                    os.remove(GetLastPathElement(a))
 
38
+                shutil.move(a, ".")
 
39
+                Warn("Moved " + a + " -> " + LibDir + "/" + GetLastPathElement(a) )
 
40
 
 
41
     if IsUbuntu() and not IsPackagedUbuntu():
 
42
         # Support for Ubuntu's upstart configuration