On 11/10/2014 05:52 PM, Aaron Karper wrote: > On Thu, Nov 06, 2014 at 12:30:41AM +0200, Alex Pyrgiotis wrote: >> The _UnlockedAttachInstanceDisk and _UnlockedDetachInstanceDisk >> functions are already used in the add and remove operations. Create >> wrappers that can be used by attach and detach operations in order to >> call only these functions. >> >> Signed-off-by: Alex Pyrgiotis <[email protected] <mailto:[email protected]>> >> >> diff --git a/lib/config.py b/lib/config.py >> index cd4400b..d47ee22 100644 >> --- a/lib/config.py >> +++ b/lib/config.py >> @@ -503,6 +503,15 @@ class ConfigWriter(object): >> self._UnlockedAddDisk(disk) >> self.___UnlockedAttachInstanceDisk(__inst_uuid, disk.uuid, idx) >> >> + @_ConfigSync() >> + def AttachInstanceDisk(self, inst_uuid, disk, idx=None): >> + """Attach an existing disk to an instance. >> + >> + This is a simple wrapper over L{_UnlockedAttachInstanceDisk}__. >> + >> + """ >> + self.___UnlockedAttachInstanceDisk(__inst_uuid, disk.uuid, idx) >> + > > Here you pass the disk info > >> def _UnlockedDetachInstanceDisk(__self, inst_uuid, disk_uuid): >> """Detach a disk from an instance. >> >> @@ -563,6 +572,14 @@ class ConfigWriter(object): >> self.___UnlockedDetachInstanceDisk(__inst_uuid, disk_uuid) >> self._UnlockedRemoveDisk(disk___uuid) >> >> + @_ConfigSync() >> + def DetachInstanceDisk(self, inst_uuid, disk_uuid): >> + """Detach a disk from an instance. >> + >> + This is a simple wrapper over L{_UnlockedDetachInstanceDisk}__. >> + """ >> + self.___UnlockedDetachInstanceDisk(__inst_uuid, disk_uuid) >> + > > and here you pass the disk uuid. This should be consistent. >
ACK. >> >> def _UnlockedGetDiskInfo(self, disk_uuid): >> """Returns information about a disk. >> >> -- >> 1.7.10.4 >> > > -- > Google Germany GmbH > Dienerstr. 12 > 80331 München > > Registergericht und -nummer: Hamburg, HRB 86891 > Sitz der Gesellschaft: Hamburg > Geschäftsführer: Graham Law, Christine Elizabeth Flores -- Alex | [email protected]
