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

Issue 10340044: Add config-related methods in the Azure provider.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by rvb
Modified:
10 years, 10 months ago
Reviewers:
mue, mp+169759, fwereade
Visibility:
Public.

Description

Add config-related methods in the Azure provider. You'll notice that the locking in our Environ implementation is different from what the other providers do. The other providers do it like this: * For read-only access to the Environ object, use the locking getter methods. * For read-write access, lock the object and access its attributes directly. We found this a little error-prone: it's easy to forget to use a getter (leading to a subtle concurrency bug), or to use one when you shouldn't (leading to a deadlock panic), or to risk seeing an inconsistent view of the object (by calling one locking getter and then another — the object may have changed in the meantime). So instead we have a method that creates atomic ("snapshot") copies of an Environ object. You can do all you like with your copy, because it has no effect on the original. Use of the snapshot goes like: * For read-only access to the Environ object, obtain a snapshot. Access its attributes directly. * For read-write access, lock the object. Access its attributes directly. https://code.launchpad.net/~rvb/juju-core/az-config-items2/+merge/169759 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+440 lines, -17 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
A environs/azure/azure_test.go View 1 chunk +26 lines, -0 lines 0 comments Download
A environs/azure/config.go View 1 chunk +143 lines, -0 lines 1 comment Download
A environs/azure/config_test.go View 1 chunk +199 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 1 chunk +32 lines, -2 lines 0 comments Download
A environs/azure/environ_test.go View 1 chunk +38 lines, -0 lines 0 comments Download
M environs/azure/environprovider.go View 1 chunk +0 lines, -15 lines 0 comments Download

Messages

Total messages: 3
rvb
Please take a look.
10 years, 10 months ago (2013-06-17 15:41:34 UTC) #1
fwereade
Note descended from https://codereview.appspot.com/10338043/ LGTM
10 years, 10 months ago (2013-06-18 06:16:50 UTC) #2
mue
10 years, 10 months ago (2013-06-18 07:23:06 UTC) #3
LGTM

https://codereview.appspot.com/10340044/diff/1/environs/azure/config.go
File environs/azure/config.go (right):

https://codereview.appspot.com/10340044/diff/1/environs/azure/config.go#newco...
environs/azure/config.go:71: // Validate is specified in the EnvironProvider
interface.
// Validate ensures that config is a valid configuration for this
// provider like specified in the EnvironProvider interface.
Sign in to reply to this message.

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