← Back to team overview

launchpad-reviewers team mailing list archive

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

 

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

Commit message:
Fix Ports() and friends so they return nothing, enabling the core to finish a deployment.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~julian-edwards/juju-core/ports/+merge/158000

This fixes the remaining part of the maas provider blocking an actual deployment.  With this change and the other outstanding merges I can successfully deploy a charm.

I deliberately didn't write tests for this change.  MAAS does not do firewalling so we just return as little as possible to keep the core happy.  If/when MAAS can firewall, then tests are relevant.
-- 
https://code.launchpad.net/~julian-edwards/juju-core/ports/+merge/158000
Your team MAAS Maintainers is requested to review the proposed merge of lp:~julian-edwards/juju-core/ports 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 06:56:28 +0000
@@ -517,16 +517,17 @@
 	return state.AssignUnused
 }
 
+// MAAS does not do firewalling so these port methods do nothing.
 func (*maasEnviron) OpenPorts([]params.Port) error {
-	panic("Not implemented.")
+	return nil
 }
 
 func (*maasEnviron) ClosePorts([]params.Port) error {
-	panic("Not implemented.")
+	return nil
 }
 
 func (*maasEnviron) Ports() ([]params.Port, error) {
-	panic("Not implemented.")
+	return []params.Port{}, nil
 }
 
 func (*maasEnviron) Provider() environs.EnvironProvider {

=== modified file 'environs/maas/instance.go'
--- environs/maas/instance.go	2013-04-05 04:08:32 +0000
+++ environs/maas/instance.go	2013-04-10 06:56:28 +0000
@@ -45,14 +45,15 @@
 	return instance.DNSName()
 }
 
+// MAAS does not do firewalling so these port methods do nothing.
 func (instance *maasInstance) OpenPorts(machineId string, ports []params.Port) error {
-	panic("Not implemented.")
+	return nil
 }
 
 func (instance *maasInstance) ClosePorts(machineId string, ports []params.Port) error {
-	panic("Not implemented.")
+	return nil
 }
 
 func (instance *maasInstance) Ports(machineId string) ([]params.Port, error) {
-	panic("Not implemented.")
+	return []params.Port{}, nil
 }