summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2013-01-31 11:42:39 -0700
committerusd-importer <ubuntu-server@lists.ubuntu.com>2013-02-01 06:03:53 +0000
commit685b8d0632e2d5fc20a5778904be3a0b1cbc2337 (patch)
treeedfd280de36950396104040c2b07cd07b0e46426
parent34fd9d919b439b0bdc83c95230c9519470334caa (diff)
parent260b4feb941437777b8560b8c16e2dda853fd42b (diff)
downloadvyos-walinuxagent-685b8d0632e2d5fc20a5778904be3a0b1cbc2337.tar.gz
vyos-walinuxagent-685b8d0632e2d5fc20a5778904be3a0b1cbc2337.zip
Import patches-applied version 1.3-0ubuntu2 to applied/ubuntu/raring-proposed
Imported using git-ubuntu import. Changelog parent: 34fd9d919b439b0bdc83c95230c9519470334caa Unapplied parent: 260b4feb941437777b8560b8c16e2dda853fd42b New changelog entries: * Changed detection of whether or not agent is packaged to using dpkg command. (LP: #1111690)
-rw-r--r--debian/changelog7
-rw-r--r--debian/default4
-rw-r--r--debian/patches/000_use_packaged_upstart23
-rw-r--r--waagent16
4 files changed, 29 insertions, 21 deletions
diff --git a/debian/changelog b/debian/changelog
index cab8551..242022a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+walinuxagent (1.3-0ubuntu2) raring; urgency=low
+
+ * Changed detection of whether or not agent is packaged to using
+ dpkg command. (LP: #1111690)
+
+ -- Ben Howard <ben.howard@ubuntu.com> Thu, 31 Jan 2013 11:42:39 -0700
+
walinuxagent (1.3-0ubuntu1) raring; urgency=low
* New upstream version (LP: #1101371)
diff --git a/debian/default b/debian/default
index a6bdf50..a17174c 100644
--- a/debian/default
+++ b/debian/default
@@ -1,6 +1,2 @@
# To disable the Windows Azure Agent, set WALINUXAGENT_ENABLED=0
WALINUXAGENT_ENABLED=1
-
-# Setting this variable to anything other than 1, runs the script
-# in stand-alone mode. This is heavily, heavily discouraged.
-WAXLINUXAGENT_PACKAGED=1
diff --git a/debian/patches/000_use_packaged_upstart b/debian/patches/000_use_packaged_upstart
index fa933a8..463ae57 100644
--- a/debian/patches/000_use_packaged_upstart
+++ b/debian/patches/000_use_packaged_upstart
@@ -8,21 +8,26 @@
Verbose = False
WaAgent = None
DiskActivated = False
-@@ -84,6 +85,18 @@ def DetectLinuxDistro():
+@@ -79,11 +80,23 @@ def IsLinux():
+
+ def DetectLinuxDistro():
+ global LinuxDistro
++ global PackagedForDistro
+ if os.path.isfile("/etc/redhat-release"):
+ LinuxDistro = "RedHat"
return True
if os.path.isfile("/etc/lsb-release") and "Ubuntu" in GetFileContents("/etc/lsb-release"):
LinuxDistro = "Ubuntu"
+
+ # Should this run as if it is packaged Ubuntu?
-+ if os.path.isfile("/etc/default/walinuxagent"):
-+ try:
-+ with open('/etc/default/walinuxagent') as f:
-+ for line in f.readlines():
-+ if line == "WAXLINUXAGENT_PACKAGED=1":
-+ PackagedForDistro = "Ubuntu"
++ try:
++ cmd="dpkg -S %s" % os.path.basename(__file__)
++ retcode, krn = RunSafe(cmd)
++ if not retcode:
++ PackagedForDistro = "Ubuntu"
+
-+ except IOError as e:
-+ pass
++ except IOError as e:
++ pass
+
return True
if os.path.isfile("/etc/debian_version"):
diff --git a/waagent b/waagent
index 8dd4ca2..0469435 100644
--- a/waagent
+++ b/waagent
@@ -80,6 +80,7 @@ def IsLinux():
def DetectLinuxDistro():
global LinuxDistro
+ global PackagedForDistro
if os.path.isfile("/etc/redhat-release"):
LinuxDistro = "RedHat"
return True
@@ -87,15 +88,14 @@ def DetectLinuxDistro():
LinuxDistro = "Ubuntu"
# Should this run as if it is packaged Ubuntu?
- if os.path.isfile("/etc/default/walinuxagent"):
- try:
- with open('/etc/default/walinuxagent') as f:
- for line in f.readlines():
- if line == "WAXLINUXAGENT_PACKAGED=1":
- PackagedForDistro = "Ubuntu"
+ try:
+ cmd="dpkg -S %s" % os.path.basename(__file__)
+ retcode, krn = RunSafe(cmd)
+ if not retcode:
+ PackagedForDistro = "Ubuntu"
- except IOError as e:
- pass
+ except IOError as e:
+ pass
return True
if os.path.isfile("/etc/debian_version"):