~ubuntu-branches/ubuntu/trusty/juju-core/trusty-proposed

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/state/export_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-03 09:22:46 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20140203092246-e03vg402vztzo4qa
Tags: 1.17.2-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
        "labix.org/v2/mgo"
13
13
        gc "launchpad.net/gocheck"
14
14
 
 
15
        "labix.org/v2/mgo/txn"
15
16
        "launchpad.net/juju-core/charm"
16
17
        "launchpad.net/juju-core/environs/config"
17
18
        "launchpad.net/juju-core/instance"
167
168
var JobNames = jobNames
168
169
 
169
170
// SCHEMACHANGE
170
 
// This method is used to reset a deprecated machine attriute.
 
171
// This method is used to reset a deprecated machine attribute.
171
172
func SetMachineInstanceId(m *Machine, instanceId string) {
172
173
        m.doc.InstanceId = instance.Id(instanceId)
173
174
}
174
175
 
175
 
//SCHEMACHANGE
 
176
// SCHEMACHANGE
 
177
// ClearInstanceDocId sets instanceid on instanceData for machine to "".
 
178
func ClearInstanceDocId(c *gc.C, m *Machine) {
 
179
        ops := []txn.Op{
 
180
                {
 
181
                        C:      m.st.instanceData.Name,
 
182
                        Id:     m.doc.Id,
 
183
                        Assert: txn.DocExists,
 
184
                        Update: D{{"$set", D{{"instanceid", ""}}}},
 
185
                },
 
186
        }
 
187
 
 
188
        err := m.st.runTransaction(ops)
 
189
        c.Assert(err, gc.IsNil)
 
190
}
 
191
 
 
192
// SCHEMACHANGE
176
193
// This method is used to reset the ownertag attribute
177
194
func SetServiceOwnerTag(s *Service, ownerTag string) {
178
195
        s.doc.OwnerTag = ownerTag
179
196
}
180
197
 
181
 
//SCHEMACHANGE
 
198
// SCHEMACHANGE
182
199
// Get the owner directly
183
200
func GetServiceOwnerTag(s *Service) string {
184
201
        return s.doc.OwnerTag
224
241
        return u.doc.PasswordSalt, u.doc.PasswordHash
225
242
}
226
243
 
227
 
func StateServerMachineIds(st *State) ([]string, error) {
228
 
        return st.stateServerMachineIds()
229
 
}
230
 
 
231
244
var NewAddress = newAddress
232
245
 
233
246
func CheckUserExists(st *State, name string) (bool, error) {