Updated Branches:
  refs/heads/4.1 903aeb9b7 -> d5a474a91

Have cloud-setup-* tools detect Debian

Reviewed-by: Wido (https://reviews.apache.org/r/9310)

To minimize this change, treat Debian as Ubuntu for now.
(cherry picked from commit ebb7c2e063aa2fd17955dedd993fa678556754c2)

Signed-off-by: Rohit Yadav <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d5a474a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d5a474a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d5a474a9

Branch: refs/heads/4.1
Commit: d5a474a91d936104c360794835599e37fcda56b0
Parents: 903aeb9
Author: Noa Resare <[email protected]>
Authored: Sat Jan 12 20:34:32 2013 +0000
Committer: Rohit Yadav <[email protected]>
Committed: Mon Feb 25 12:30:08 2013 +0530

----------------------------------------------------------------------
 debian/control                     |    2 +-
 python/lib/cloudutils/utilities.py |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d5a474a9/debian/control
----------------------------------------------------------------------
diff --git a/debian/control b/debian/control
index 380b2e4..e9697ea 100644
--- a/debian/control
+++ b/debian/control
@@ -48,7 +48,7 @@ Description: CloudStack server library
 Package: cloud-scripts
 Replaces: cloud-agent-scripts
 Architecture: any
-Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, 
openssh-client
+Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, 
openssh-client, lsb-release
 Description: CloudStack scripts
  This package contains a number of scripts needed for the CloudStack Agent and 
Management Server.
  Both the CloudStack Agent and Management server depend on this package

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d5a474a9/python/lib/cloudutils/utilities.py
----------------------------------------------------------------------
diff --git a/python/lib/cloudutils/utilities.py 
b/python/lib/cloudutils/utilities.py
index c9d1e33..739a483 100755
--- a/python/lib/cloudutils/utilities.py
+++ b/python/lib/cloudutils/utilities.py
@@ -122,7 +122,14 @@ class Distribution:
             if kernel.find("2.6.32") != -1:
                 self.release = "10.04"
             self.arch = bash("uname -m").getStdout()
-            
+        elif os.path.exists("/usr/bin/lsb_release"):
+            o = bash("/usr/bin/lsb_release -i")
+            distributor = o.getStdout().split(":\t")[1]
+            if "Debian" in distributor:
+                # This obviously needs a rewrite at some point
+                self.distro = "Ubuntu"
+            else:
+                raise UnknownSystemException(distributor)
         else: 
             raise UnknownSystemException
 

Reply via email to