Demo code to set block devices in state #16

Merged
merged 2 commits into from Jan 29, 2015

Conversation

Projects
None yet
2 participants
Owner

wallyworld commented Jan 29, 2015

After creating the block devices on a machine, record the info in state.

api/provisioner/machine.go
@@ -327,3 +327,20 @@ func (m *Machine) SetSupportedContainers(containerTypes ...instance.ContainerTyp
func (m *Machine) SupportsNoContainers() error {
return m.SetSupportedContainers([]instance.ContainerType{}...)
}
+
+// DEMO ONLY - NOT PRODUCTION
+// This duplicates api on diskmanager. Need to consolidate.
@axw

axw Jan 29, 2015

Collaborator

not really, once we separate volumes/block-devices

apiserver/provisioner/provisioner.go
+ result.Results[i].Error = common.ServerError(common.ErrPerm)
+ continue
+ }
+ err = m.SetMachineBlockDevices(stateBlockDeviceInfo(arg.BlockDevices)...)
@axw

axw Jan 29, 2015

Collaborator

This should be using state.setProvisionedBlockDeviceInfo, not SetMachineBlockDevices.

Collaborator

axw commented Jan 29, 2015

Please use setProvisionedBlockDeviceInfo instead. With that, LGTM.

wallyworld added a commit that referenced this pull request Jan 29, 2015

Merge pull request #16 from wallyworld/demo-setblockdevices
Demo code to set block devices in state

@wallyworld wallyworld merged commit 708c954 into storage-feature Jan 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment