Merge lp:~andreserl/maas/lp1563094 into lp:~maas-committers/maas/trunk

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 4851
Proposed branch: lp:~andreserl/maas/lp1563094
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 57 lines (+13/-5)
3 files modified
src/maasserver/utils/tests/test_version.py (+5/-0)
src/maasserver/utils/version.py (+7/-4)
utilities/remote-reinstall (+1/-1)
To merge this branch: bzr merge lp:~andreserl/maas/lp1563094
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+290334@code.launchpad.net

This proposal supersedes a proposal from 2016-03-29.

Commit message

Fix determination of installed version.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Missing tests?

review: Needs Fixing
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (32.9 KiB)

The attempt to merge lp:~andreserl/maas/lp1563094 into lp:maas failed. Below is the output from the failed tests.

Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:2 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial InRelease [116 kB]
Hit:3 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:5 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/main Sources [1,107 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe Sources [7,517 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,437 kB]
Get:8 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,249 kB]
Fetched 17.4 MB in 3s (5,266 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
    --no-install-recommends install apache2 archdetect-deb authbind bind9 bind9utils build-essential bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils firefox freeipmi-tools git gjs ipython isc-dhcp-common libjs-angularjs libjs-jquery libjs-jquery-hotkeys libjs-yui3-full libjs-yui3-min libpq-dev make nodejs-legacy npm postgresql pxelinux python3-all python3-apt python3-bson python3-convoy python3-coverage python3-crochet python3-cssselect python3-curtin python3-dev python3-distro-info python3-django python3-django-nose python3-django-piston3 python3-dnspython python3-docutils python3-formencode python3-hivex python3-httplib2 python3-jinja2 python3-jsonschema python3-lxml python3-mock python3-netaddr python3-netifaces python3-oauth python3-oauthlib python3-openssl python3-paramiko python3-petname python3-pexpect python3-psycopg2 python3-pyinotify python3-pyparsing python3-pyvmomi python3-requests python3-seamicroclient python3-setuptools python3-simplestreams python3-sphinx python3-tempita python3-twisted python3-txtftp python3-tz python3-yaml python3-zope.interface python-bson python-crochet python-django python-django-piston python-djorm-ext-pgarray python-formencode python-lxml python-netaddr python-netifaces python-pocket-lint python-psycopg2 python-tempita python-twisted python-yaml socat syslinux-common tgt ubuntu-cloudimage-keyring wget xvfb
Reading package lists...
Building dependency tree...
Reading state information...
apache2 is already the newest version (2.4.18-1ubuntu1).
archdetect-deb is already the newest version (1.114ubuntu4).
authbind is already the newest version (2.1.1+nmu1).
bind9 is already the newest version (1:9.10.3.dfsg.P4-5).
bind9utils is already the newest version (1:9.10.3.dfsg.P4-5).
build-essential is already the newest version (12.1ubuntu2).
curl is already the newest version (7.47.0-1ubuntu2).
debhelper is already the newest version (9.20160115ubuntu2).
dh-apport is already the newest version (2.20-0ubuntu3).
dh-systemd is already the newest version (1.29ubuntu1).
distro-info is already the newest version (0.14build1).
dnsutils is already the newest version (1:9.10.3.dfsg.P4-5).
firefox is already the n...

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (32.8 KiB)

The attempt to merge lp:~andreserl/maas/lp1563094 into lp:maas failed. Below is the output from the failed tests.

Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:2 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial InRelease [116 kB]
Hit:3 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:5 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe Sources [7,517 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,437 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,249 kB]
Fetched 16.3 MB in 3s (5,233 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
    --no-install-recommends install apache2 archdetect-deb authbind bind9 bind9utils build-essential bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils firefox freeipmi-tools git gjs ipython isc-dhcp-common libjs-angularjs libjs-jquery libjs-jquery-hotkeys libjs-yui3-full libjs-yui3-min libpq-dev make nodejs-legacy npm postgresql pxelinux python3-all python3-apt python3-bson python3-convoy python3-coverage python3-crochet python3-cssselect python3-curtin python3-dev python3-distro-info python3-django python3-django-nose python3-django-piston3 python3-dnspython python3-docutils python3-formencode python3-hivex python3-httplib2 python3-jinja2 python3-jsonschema python3-lxml python3-mock python3-netaddr python3-netifaces python3-oauth python3-oauthlib python3-openssl python3-paramiko python3-petname python3-pexpect python3-psycopg2 python3-pyinotify python3-pyparsing python3-pyvmomi python3-requests python3-seamicroclient python3-setuptools python3-simplestreams python3-sphinx python3-tempita python3-twisted python3-txtftp python3-tz python3-yaml python3-zope.interface python-bson python-crochet python-django python-django-piston python-djorm-ext-pgarray python-formencode python-lxml python-netaddr python-netifaces python-pocket-lint python-psycopg2 python-tempita python-twisted python-yaml socat syslinux-common tgt ubuntu-cloudimage-keyring wget xvfb
Reading package lists...
Building dependency tree...
Reading state information...
apache2 is already the newest version (2.4.18-1ubuntu1).
archdetect-deb is already the newest version (1.114ubuntu4).
authbind is already the newest version (2.1.1+nmu1).
bind9 is already the newest version (1:9.10.3.dfsg.P4-5).
bind9utils is already the newest version (1:9.10.3.dfsg.P4-5).
build-essential is already the newest version (12.1ubuntu2).
curl is already the newest version (7.47.0-1ubuntu2).
debhelper is already the newest version (9.20160115ubuntu2).
dh-apport is already the newest version (2.20-0ubuntu3).
dh-systemd is already the newest version (1.29ubuntu1).
distro-info is already the newest version (0.14build1).
dnsutils is already the newest version (1:9.10.3.dfsg.P4-5).
firefox is already the newest version (45.0.1+build1-0ubuntu1).
freeipmi-tools is already the newest version (1.4.11-1...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/utils/tests/test_version.py'
2--- src/maasserver/utils/tests/test_version.py 2015-12-01 18:12:59 +0000
3+++ src/maasserver/utils/tests/test_version.py 2016-03-29 23:27:09 +0000
4@@ -72,6 +72,11 @@
5 call_and_check.side_effect = shell.ExternalProcessError(2, "cmd")
6 self.assertIsNone(version.get_maas_branch_version())
7
8+ def test__returns_None_if_bzr_not_found(self):
9+ call_and_check = self.patch(shell, "call_and_check")
10+ call_and_check.side_effect = FileNotFoundError()
11+ self.assertIsNone(version.get_maas_branch_version())
12+
13 def test__returns_None_if_bzr_emits_something_thats_not_a_number(self):
14 call_and_check = self.patch(shell, "call_and_check")
15 call_and_check.return_value = b"???"
16
17=== modified file 'src/maasserver/utils/version.py'
18--- src/maasserver/utils/version.py 2015-12-01 18:12:59 +0000
19+++ src/maasserver/utils/version.py 2016-03-29 23:27:09 +0000
20@@ -17,7 +17,7 @@
21 apt_pkg.init()
22
23 # Name of maas package to get version from.
24-REGION_PACKAGE_NAME = "maas-region-controller-min"
25+REGION_PACKAGE_NAME = "maas-region-api"
26
27
28 def get_version_from_apt(package):
29@@ -61,9 +61,12 @@
30 try:
31 revno = shell.call_and_check(("bzr", "revno", __file__))
32 except shell.ExternalProcessError:
33- # We may not be in a Bazaar working tree, or Bazaar is not installed,
34- # or any manner of other errors. For the purposes of this function we
35- # don't care; simply say we don't know.
36+ # We may not be in a Bazaar working tree, or any manner of other
37+ # errors. For the purposes of this function we don't care; simply say
38+ # we don't know.
39+ return None
40+ except FileNotFoundError:
41+ # Bazaar is not installed. We don't care and simply say we don't know.
42 return None
43 else:
44 # `bzr revno` can return '???' when it can't find the working tree's
45
46=== modified file 'utilities/remote-reinstall'
47--- utilities/remote-reinstall 2016-03-25 14:52:23 +0000
48+++ utilities/remote-reinstall 2016-03-29 23:27:09 +0000
49@@ -28,7 +28,7 @@
50 ssh_run="ssh -oBatchMode=yes -l root $hostname"
51
52 echo "Checking $hostname..."
53-maas_version=$($ssh_run "dpkg -s maas-region-controller-min | grep ^Version") \
54+maas_version=$($ssh_run "dpkg -s maas-region-api | grep ^Version") \
55 || die "Cannot SSH to root@$hostname."
56 ip_address=$(get_ip $hostname)
57 maas_version=$(echo $maas_version | cut -d':' -f 2)