Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(47)

Delta Between Two Patch Sets: cmd/juju/unexpose.go

Issue 6488077: juju: always connect to State.
Left Patch Set: juju: always connect to State. Created 12 years, 7 months ago
Right Patch Set: juju: always connect to State. Created 12 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « cmd/juju/status.go ('k') | environs/jujutest/livetests.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package main 1 package main
2 2
3 import ( 3 import (
4 "errors" 4 "errors"
5 5
6 "launchpad.net/gnuflag" 6 "launchpad.net/gnuflag"
7 "launchpad.net/juju-core/cmd" 7 "launchpad.net/juju-core/cmd"
8 "launchpad.net/juju-core/juju" 8 "launchpad.net/juju-core/juju"
9 ) 9 )
10 10
(...skipping 16 matching lines...) Expand all
27 if len(args) == 0 { 27 if len(args) == 0 {
28 return errors.New("no service name specified") 28 return errors.New("no service name specified")
29 } 29 }
30 c.ServiceName = args[0] 30 c.ServiceName = args[0]
31 return cmd.CheckEmpty(args[1:]) 31 return cmd.CheckEmpty(args[1:])
32 } 32 }
33 33
34 // Run changes the juju-managed firewall to hide any 34 // Run changes the juju-managed firewall to hide any
35 // ports that were also explicitly marked by units as closed. 35 // ports that were also explicitly marked by units as closed.
36 func (c *UnexposeCommand) Run(_ *cmd.Context) error { 36 func (c *UnexposeCommand) Run(_ *cmd.Context) error {
37 » conn, err := juju.NewConn(c.EnvName) 37 » conn, err := juju.NewConnFromName(c.EnvName)
38 if err != nil { 38 if err != nil {
39 return err 39 return err
40 } 40 }
41 defer conn.Close() 41 defer conn.Close()
42 svc, err := conn.State.Service(c.ServiceName) 42 svc, err := conn.State.Service(c.ServiceName)
43 if err != nil { 43 if err != nil {
44 return err 44 return err
45 } 45 }
46 return svc.ClearExposed() 46 return svc.ClearExposed()
47 } 47 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b