← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~julian-edwards/juju-core/pass-base-address into lp:~maas-maintainers/juju-core/maas-provider-skeleton

 

Julian Edwards has proposed merging lp:~julian-edwards/juju-core/pass-base-address into lp:~maas-maintainers/juju-core/maas-provider-skeleton.

Commit message:
Use the new gomaasapi changes that require an explicit base url and separate version when creating a client.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~julian-edwards/juju-core/pass-base-address/+merge/157980
-- 
https://code.launchpad.net/~julian-edwards/juju-core/pass-base-address/+merge/157980
Your team MAAS Maintainers is requested to review the proposed merge of lp:~julian-edwards/juju-core/pass-base-address into lp:~maas-maintainers/juju-core/maas-provider-skeleton.
=== modified file 'environs/maas/environ.go'
--- environs/maas/environ.go	2013-04-09 06:52:42 +0000
+++ environs/maas/environ.go	2013-04-10 02:23:24 +0000
@@ -280,7 +280,8 @@
 	env.name = cfg.Name()
 	env.ecfgUnlocked = ecfg
 
-	authClient, err := gomaasapi.NewAuthenticatedClient(ecfg.MAASServer(), ecfg.MAASOAuth())
+	// We're using v1.0 of the MAAS API.
+	authClient, err := gomaasapi.NewAuthenticatedClient(ecfg.MAASServer(), ecfg.MAASOAuth(), "1.0")
 	if err != nil {
 		return err
 	}

=== modified file 'environs/maas/environ_test.go'
--- environs/maas/environ_test.go	2013-04-09 06:52:42 +0000
+++ environs/maas/environ_test.go	2013-04-10 02:23:24 +0000
@@ -46,7 +46,7 @@
 		"ca-cert":         testing.CACert,
 		"ca-private-key":  testing.CAKey,
 		"maas-oauth":      "a:b:c",
-		"maas-server":     suite.testMAASObject.URL().String(),
+		"maas-server":     suite.testMAASObject.TestServer.URL,
 	})
 	if err != nil {
 		panic(err)
@@ -81,7 +81,7 @@
 	errSetConfig := env.SetConfig(cfg2)
 	c.Check(errSetConfig, IsNil)
 	c.Check(env.name, Equals, anotherName)
-	authClient, _ := gomaasapi.NewAuthenticatedClient(anotherServer, anotherOauth)
+	authClient, _ := gomaasapi.NewAuthenticatedClient(anotherServer, anotherOauth, "1.0")
 	maas := gomaasapi.NewMAAS(*authClient)
 	MAASServer := env.maasClientUnlocked
 	c.Check(MAASServer, DeepEquals, maas)

=== modified file 'environs/maas/environprovider.go'
--- environs/maas/environprovider.go	2013-04-08 07:50:28 +0000
+++ environs/maas/environprovider.go	2013-04-10 02:23:24 +0000
@@ -28,8 +28,8 @@
 	return `
   maas:
     type: maas
-    # Change this to where your MAAS server lives.  It must specify the API endpoint.
-    maas-server: 'http://192.168.1.1/MAAS/api/1.0'
+    # Change this to where your MAAS server lives.  It must specify the base path.
+    maas-server: 'http://192.168.1.1/MAAS/'
     maas-oauth: '<add your OAuth credentials from MAAS here>'
     admin-secret: {{rand}}
     default-series: precise

=== modified file 'environs/maas/environprovider_test.go'
--- environs/maas/environprovider_test.go	2013-04-08 01:50:24 +0000
+++ environs/maas/environprovider_test.go	2013-04-10 02:23:24 +0000
@@ -20,7 +20,7 @@
 	const oauth = "aa:bb:cc"
 	attrs := map[string]interface{}{
 		"maas-oauth":      oauth,
-		"maas-server":     "http://maas.example.com/maas/api/1.0/";,
+		"maas-server":     "http://maas.example.com/maas/";,
 		"name":            "wheee",
 		"type":            "maas",
 		"authorized-keys": "I-am-not-a-real-key",