← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~smoser/maas/packaging.next-server into lp:~maas-maintainers/maas/packaging

 

Scott Moser has proposed merging lp:~smoser/maas/packaging.next-server into lp:~maas-maintainers/maas/packaging.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~smoser/maas/packaging.next-server/+merge/124493

update packaging to pass --ip to maas configure_master_dhcp


-- 
https://code.launchpad.net/~smoser/maas/packaging.next-server/+merge/124493
Your team MAAS Maintainers is requested to review the proposed merge of lp:~smoser/maas/packaging.next-server into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/changelog'
--- debian/changelog	2012-09-14 16:58:25 +0000
+++ debian/changelog	2012-09-14 18:21:20 +0000
@@ -1,9 +1,10 @@
-maas (0.1+bzr987+dfsg-0ubuntu3) UNRELEASED; urgency=low
+maas (0.1+bzr1001+dfsg-0ubuntu3) UNRELEASED; urgency=low
 
   [ Scott Moser ]
   * debian/maas-dhcp.{install,apparmor,postrm} install apparmor profile into
     /etc/apparmor.d/dhcpd.d (LP: #1049177), and update apparmor profile for
     /usr/sbin/dhcpd on install/remove
+  * get the ip address for the dhcp server in config
 
   [ Andres Rodriguez ]
   * debian/maas.postinst: Always restart apache2.

=== modified file 'debian/maas-dhcp.config'
--- debian/maas-dhcp.config	2012-09-14 01:27:09 +0000
+++ debian/maas-dhcp.config	2012-09-14 18:21:20 +0000
@@ -18,6 +18,8 @@
 		db_go
 		db_input high maas-dhcp/maas-dhcp-interface || true
 		db_go
+		db_input low maas-dhcp/maas-dhcp-addr || true
+		db_go
 	fi
 
 fi

=== modified file 'debian/maas-dhcp.postinst'
--- debian/maas-dhcp.postinst	2012-09-14 16:58:25 +0000
+++ debian/maas-dhcp.postinst	2012-09-14 18:21:20 +0000
@@ -28,9 +28,20 @@
 		db_get maas-dhcp/maas-dhcp-interface || true
 		interface="$RET"
 
+		# Obtain the interfaces
+		db_get maas-dhcp/maas-dhcp-addr || true
+		addr="$RET"
+
+		if [ -z "$addr" ]; then
+			addr=$(ifconfig "$interface" |
+			       awk '$1 == "inet" { sub("addr:","",$2); print $2 }')
+			[ -n "$addr" ] ||
+				{ echo "failed to get ip for $interface" 1>&2; exit 1; }
+		fi
+
 		maas config_master_dhcp --ip-range-low="$range_low" --ip-range-high="$range_high" \
 				--router-ip="$gateway" --subnet-mask="$netmask" --broadcast-ip="$broadcast" \
-				--interface="$interface"
+				--interface="$interface" --ip="$addr"
 	fi
 
 fi

=== modified file 'debian/maas-dhcp.postrm'
--- debian/maas-dhcp.postrm	2012-09-14 16:58:25 +0000
+++ debian/maas-dhcp.postrm	2012-09-14 18:21:20 +0000
@@ -7,3 +7,5 @@
       apparmor_parser --replace --write-cache --skip-read-cache "${dhcpd_prof}"
    fi
 fi
+
+#DEBHELPER#

=== modified file 'debian/maas-dhcp.templates'
--- debian/maas-dhcp.templates	2012-09-14 01:27:09 +0000
+++ debian/maas-dhcp.templates	2012-09-14 18:21:20 +0000
@@ -54,3 +54,12 @@
  Ubuntu MAAS Server can manage DHCP for address allocation for
  the provisioned systems. The DHCP server requires you to set a network
  interface on which DHCP will serve IP addresses. The default is eth0.
+
+Template: maas-dhcp/maas-dhcp-addr
+Type: string
+Default:
+_Description: The IP address at which nodes can reach the DHCP server
+ Ubuntu MAAS Server can manage DHCP for address allocation for
+ the provisioned systems. The DHCP server requires you to set an IP
+ address at which nodes can reach the DHCP server. If left blank
+ then the ip address of the dhcp-interface will be used.

=== added file 'debian/patches/04-add-maas-integration.py'
--- debian/patches/04-add-maas-integration.py	1970-01-01 00:00:00 +0000
+++ debian/patches/04-add-maas-integration.py	2012-09-14 18:21:20 +0000
@@ -0,0 +1,75 @@
+--- /dev/null
++++ b/tests/maas-integration.py
+@@ -0,0 +1,72 @@
++# TODO
++#  - send ipmi commands to turn on/off nodes
++#  - run import pxe files
++#  - check node states once they're on/off
++#  - check node state changes (declared -> commissionig -> ready)
++import os
++from subprocess import check_output
++import sys
++from unittest import TestCase
++
++from pyvirtualdisplay import Display
++from sst.actions import (
++    assert_url, assert_text_contains, assert_title_contains, click_button,
++    get_element, go_to, write_textfield)
++
++
++sys.path.insert(0, "/usr/share/maas")
++os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
++from maasserver.models import User
++
++MAAS_URL = "http://10.98.0.13/MAAS";
++ADMIN_USER = "admin"
++PASSWORD = "test"
++
++
++class TestMAASIntegration(TestCase):
++
++    def setUp(self):
++        self.display = Display(visible=0, size=(1280, 1024))
++        self.display.start()
++
++    def tearDown(self):
++        self.display.stop()
++
++    def createadmin(self):
++        """Run sudo maas createsuperuser."""
++        cmd_output = check_output(
++            ["sudo", "maas", "createsuperuser", "--username=%s" % ADMIN_USER,
++            "--email=example@xxxxxxxxxxxxx", "--noinput"])
++        ## Set password for admin user.
++        try:
++            admin = User.objects.get(username=ADMIN_USER)
++        except User.DoesNotExist:
++            admin = User(username=ADMIN_USER)
++        admin.set_password(PASSWORD)
++        admin.save()
++        return cmd_output
++
++    def installation(self):
++        # Check the installation worked.
++        go_to(MAAS_URL)
++        assert_text_contains(
++            get_element(tag="body"), "No admin user has been created yet")
++
++    def createadmin_and_login(self):
++        ## Creates the admin user.
++        output = self.createadmin()
++        self.assertEqual(output, 'Superuser created successfully.')
++        ## Login with the newly created admin user
++        go_to(MAAS_URL)
++        assert_text_contains(
++            get_element(tag="body"), "Login to lenovo-RD230-01 MAAS")
++        write_textfield("id_username", ADMIN_USER)
++        write_textfield("id_password", PASSWORD)
++        click_button("Login")
++        assert_url("MAAS/")
++        assert_title_contains("Dashboard")
++
++    def test_integration(self):
++        # Run the integration tests in order.
++        self.installation()
++        self.createadmin_and_login()

=== modified file 'debian/patches/series'
--- debian/patches/series	2012-08-29 02:56:47 +0000
+++ debian/patches/series	2012-09-14 18:21:20 +0000
@@ -1,3 +1,4 @@
 01-fix-database-settings.patch
 02-pserv-config.patch
 03-txlongpoll-config.patch
+04-add-maas-integration.py

=== removed directory 'tests'
=== removed file 'tests/maas-integration.py'
--- tests/maas-integration.py	2012-09-10 19:28:15 +0000
+++ tests/maas-integration.py	1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
-# TODO
-#  - send ipmi commands to turn on/off nodes
-#  - run import pxe files
-#  - check node states once they're on/off
-#  - check node state changes (declared -> commissionig -> ready)
-import os
-from subprocess import check_output
-import sys
-from unittest import TestCase
-
-from pyvirtualdisplay import Display
-from sst.actions import (
-    assert_url, assert_text_contains, assert_title_contains, click_button,
-    get_element, go_to, write_textfield)
-
-
-sys.path.insert(0, "/usr/share/maas")
-os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
-from maasserver.models import User
-
-MAAS_URL = "http://10.98.0.13/MAAS";
-ADMIN_USER = "admin"
-PASSWORD = "test"
-
-
-class TestMAASIntegration(TestCase):
-
-    def setUp(self):
-        self.display = Display(visible=0, size=(1280, 1024))
-        self.display.start()
-
-    def tearDown(self):
-        self.display.stop()
-
-    def createadmin(self):
-        """Run sudo maas createsuperuser."""
-        cmd_output = check_output(
-            ["sudo", "maas", "createsuperuser", "--username=%s" % ADMIN_USER,
-            "--email=example@xxxxxxxxxxxxx", "--noinput"])
-        ## Set password for admin user.
-        try:
-            admin = User.objects.get(username=ADMIN_USER)
-        except User.DoesNotExist:
-            admin = User(username=ADMIN_USER)
-        admin.set_password(PASSWORD)
-        admin.save()
-        return cmd_output
-
-    def installation(self):
-        # Check the installation worked.
-        go_to(MAAS_URL)
-        assert_text_contains(
-            get_element(tag="body"), "No admin user has been created yet")
-
-    def createadmin_and_login(self):
-        ## Creates the admin user.
-        output = self.createadmin()
-        self.assertEqual(output, 'Superuser created successfully.')
-        ## Login with the newly created admin user
-        go_to(MAAS_URL)
-        assert_text_contains(
-            get_element(tag="body"), "Login to lenovo-RD230-01 MAAS")
-        write_textfield("id_username", ADMIN_USER)
-        write_textfield("id_password", PASSWORD)
-        click_button("Login")
-        assert_url("MAAS/")
-        assert_title_contains("Dashboard")
-
-    def test_integration(self):
-        # Run the integration tests in order.
-        self.installation()
-        self.createadmin_and_login()


Follow ups