github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/provider/cloudsigma/environfirewall.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package cloudsigma
     5  
     6  import "github.com/juju/juju/network"
     7  
     8  // Implementing the methods below (to do something other than return nil) will
     9  // cause `juju expose` to work when the firewall-mode is "global". If you
    10  // implement one of them, you should implement them all.
    11  
    12  // OpenPorts opens the given ports for the whole environment.
    13  // Must only be used if the environment was setup with the FwGlobal firewall mode.
    14  func (env *environ) OpenPorts(ports []network.PortRange) error {
    15  	logger.Warningf("pretending to open ports %v for all instances", ports)
    16  	return nil
    17  }
    18  
    19  // ClosePorts closes the given ports for the whole environment.
    20  // Must only be used if the environment was setup with the FwGlobal firewall mode.
    21  func (env *environ) ClosePorts(ports []network.PortRange) error {
    22  	logger.Warningf("pretending to close ports %v for all instances", ports)
    23  	return nil
    24  }
    25  
    26  // Ports returns the ports opened for the whole environment.
    27  // Must only be used if the environment was setup with the FwGlobal firewall mode.
    28  func (env *environ) Ports() ([]network.PortRange, error) {
    29  	return nil, nil
    30  }