Skip to content

Commit fe9df21

Browse files
Noa Resareyadvr
authored andcommitted
Have cloud-setup-* tools detect Debian
To minimize this change, treat Debian as Ubuntu for now. Reviewed-by: Wido (https://reviews.apache.org/r/9310)
1 parent a4398af commit fe9df21

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Description: CloudStack server library
4848
Package: cloud-scripts
4949
Replaces: cloud-agent-scripts
5050
Architecture: any
51-
Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, openssh-client
51+
Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, openssh-client, lsb-release
5252
Description: CloudStack scripts
5353
This package contains a number of scripts needed for the CloudStack Agent and Management Server.
5454
Both the CloudStack Agent and Management server depend on this package

python/lib/cloudutils/utilities.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ def __init__(self):
122122
if kernel.find("2.6.32") != -1:
123123
self.release = "10.04"
124124
self.arch = bash("uname -m").getStdout()
125-
125+
elif os.path.exists("/usr/bin/lsb_release"):
126+
o = bash("/usr/bin/lsb_release -i")
127+
distributor = o.getStdout().split(":\t")[1]
128+
if "Debian" in distributor:
129+
# This obviously needs a rewrite at some point
130+
self.distro = "Ubuntu"
131+
else:
132+
raise UnknownSystemException(distributor)
126133
else:
127134
raise UnknownSystemException
128135

0 commit comments

Comments
 (0)