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

Delta Between Two Patch Sets: environs/maas/instance.go

Issue 9738043: cmd/jujud: do not change password
Left Patch Set: cmd/jujud: do not change password Created 11 years, 9 months ago
Right Patch Set: cmd/jujud: do not change password Created 11 years, 9 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 | « environs/maas/environprovider_test.go ('k') | environs/maas/state.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 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package maas 4 package maas
5 5
6 import ( 6 import (
7 "launchpad.net/gomaasapi" 7 "launchpad.net/gomaasapi"
8 "launchpad.net/juju-core/instance" 8 "launchpad.net/juju-core/instance"
9 "launchpad.net/juju-core/log" 9 "launchpad.net/juju-core/log"
10 ) 10 )
11 11
12 type maasInstance struct { 12 type maasInstance struct {
13 maasObject *gomaasapi.MAASObject 13 maasObject *gomaasapi.MAASObject
14 environ *maasEnviron 14 environ *maasEnviron
15 } 15 }
16 16
17 var _ instance.Instance = (*maasInstance)(nil) 17 var _ instance.Instance = (*maasInstance)(nil)
18 18
19 func (mi *maasInstance) Id() instance.Id { 19 func (mi *maasInstance) Id() instance.Id {
20 // Use the node's 'resource_uri' value. 20 // Use the node's 'resource_uri' value.
21 return instance.Id((*mi.maasObject).URI().String()) 21 return instance.Id((*mi.maasObject).URI().String())
22 }
23
24 func (mi *maasInstance) Metadata() *instance.Metadata {
25 log.Debugf("environs/maas: unimplemented Metadata() called")
26 return nil
22 } 27 }
23 28
24 // refreshInstance refreshes the instance with the most up-to-date information 29 // refreshInstance refreshes the instance with the most up-to-date information
25 // from the MAAS server. 30 // from the MAAS server.
26 func (mi *maasInstance) refreshInstance() error { 31 func (mi *maasInstance) refreshInstance() error {
27 insts, err := mi.environ.Instances([]instance.Id{mi.Id()}) 32 insts, err := mi.environ.Instances([]instance.Id{mi.Id()})
28 if err != nil { 33 if err != nil {
29 return err 34 return err
30 } 35 }
31 newMaasObject := insts[0].(*maasInstance).maasObject 36 newMaasObject := insts[0].(*maasInstance).maasObject
(...skipping 23 matching lines...) Expand all
55 60
56 func (mi *maasInstance) ClosePorts(machineId string, ports []instance.Port) erro r { 61 func (mi *maasInstance) ClosePorts(machineId string, ports []instance.Port) erro r {
57 log.Debugf("environs/maas: unimplemented ClosePorts() called") 62 log.Debugf("environs/maas: unimplemented ClosePorts() called")
58 return nil 63 return nil
59 } 64 }
60 65
61 func (mi *maasInstance) Ports(machineId string) ([]instance.Port, error) { 66 func (mi *maasInstance) Ports(machineId string) ([]instance.Port, error) {
62 log.Debugf("environs/maas: unimplemented Ports() called") 67 log.Debugf("environs/maas: unimplemented Ports() called")
63 return []instance.Port{}, nil 68 return []instance.Port{}, nil
64 } 69 }
LEFTRIGHT

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