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

Delta Between Two Patch Sets: environs/dummy/environs.go

Issue 6117064: environs: add UploadTools method
Left Patch Set: environs: add UploadTools method Created 12 years, 11 months ago
Right Patch Set: environs: add UploadTools method Created 12 years, 11 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 | « [revision details] ('k') | environs/ec2/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 package dummy 1 package dummy
2 2
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "errors" 5 "errors"
6 "fmt" 6 "fmt"
7 "io" 7 "io"
8 "io/ioutil" 8 "io/ioutil"
9 "launchpad.net/juju/go/environs" 9 "launchpad.net/juju/go/environs"
10 "launchpad.net/juju/go/schema" 10 "launchpad.net/juju/go/schema"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 if err != nil { 255 if err != nil {
256 return err 256 return err
257 } 257 }
258 e.state.mu.Lock() 258 e.state.mu.Lock()
259 e.state.files[name] = buf.Bytes() 259 e.state.files[name] = buf.Bytes()
260 e.state.mu.Unlock() 260 e.state.mu.Unlock()
261 return nil 261 return nil
262 } 262 }
263 263
264 func (*environ) UploadTools(r io.Reader, length int64, version version.Version) error { 264 func (*environ) UploadTools(r io.Reader, length int64, version version.Version) error {
265 » return fmt.Errorf("dummy environ does not support executable upload") 265 » return fmt.Errorf("dummy environment does not support executable upload" )
266 } 266 }
267 267
268 func (e *environ) GetFile(name string) (io.ReadCloser, error) { 268 func (e *environ) GetFile(name string) (io.ReadCloser, error) {
269 if e.broken { 269 if e.broken {
270 return nil, errBroken 270 return nil, errBroken
271 } 271 }
272 e.state.mu.Lock() 272 e.state.mu.Lock()
273 defer e.state.mu.Unlock() 273 defer e.state.mu.Unlock()
274 data, ok := e.state.files[name] 274 data, ok := e.state.files[name]
275 if !ok { 275 if !ok {
(...skipping 20 matching lines...) Expand all
296 return m.id 296 return m.id
297 } 297 }
298 298
299 func (m *instance) DNSName() (string, error) { 299 func (m *instance) DNSName() (string, error) {
300 return m.id + ".dns", nil 300 return m.id + ".dns", nil
301 } 301 }
302 302
303 func (m *instance) WaitDNSName() (string, error) { 303 func (m *instance) WaitDNSName() (string, error) {
304 return m.DNSName() 304 return m.DNSName()
305 } 305 }
LEFTRIGHT

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