Skip to content

Commit

Permalink
[google compute] fixes LIBCLOUD-697: allow string for ex_boot_disk on…
Browse files Browse the repository at this point in the history
… create_node

Closes apache#520

Signed-off-by: Eric Johnson <[email protected]>
  • Loading branch information
erjohnso committed May 13, 2015
1 parent 5c1a95b commit 8664118
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libcloud/compute/drivers/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ def create_node(self, name, size, image, location=None,
:type ex_metadata: ``dict`` or ``None``
:keyword ex_boot_disk: The boot disk to attach to the instance.
:type ex_boot_disk: :class:`StorageVolume` or ``str``
:type ex_boot_disk: :class:`StorageVolume` or ``str`` or ``None``
:keyword use_existing_disk: If True and if an existing disk with the
same name/location is found, use that
Expand All @@ -2265,7 +2265,7 @@ def create_node(self, name, size, image, location=None,
used. If 'None', then no external address will
be used. To use an existing static IP address,
a GCEAddress object should be passed in.
:type external_ip: :class:`GCEAddress` or ``str`` or None
:type external_ip: :class:`GCEAddress` or ``str`` or ``None``
:keyword ex_disk_type: Specify a pd-standard (default) disk or pd-ssd
for an SSD disk.
Expand Down Expand Up @@ -2356,6 +2356,8 @@ def create_node(self, name, size, image, location=None,
image = self.ex_get_image(image)
if not hasattr(ex_disk_type, 'name'):
ex_disk_type = self.ex_get_disktype(ex_disk_type, zone=location)
if ex_boot_disk and not hasattr(ex_boot_disk, 'name'):
ex_boot_disk = self.ex_get_disk(ex_boot_disk, zone=location)

# Use disks[].initializeParams to auto-create the boot disk
if not ex_disks_gce_struct and not ex_boot_disk:
Expand Down Expand Up @@ -4601,7 +4603,7 @@ def _create_node_req(self, name, size, image, location, network=None,
is made to ensure proper formatting of
the disks[] structure. Using this
structure obviates the need of using
other disk params like 'ex_boot_disk',
other disk params like 'boot_disk',
etc. See the GCE docs for specific
details.
:type ex_disks_gce_struct: ``list`` or ``None``
Expand Down Expand Up @@ -4840,7 +4842,7 @@ def _multi_create_node(self, status, node_attrs):
request, node_data = self._create_node_req(
status['name'], node_attrs['size'], node_attrs['image'],
node_attrs['location'], node_attrs['network'], node_attrs['tags'],
node_attrs['metadata'], boot_disk=status['disk'],
node_attrs['metadata'],
external_ip=node_attrs['external_ip'],
ex_service_accounts=node_attrs['ex_service_accounts'],
description=node_attrs['description'],
Expand Down

0 comments on commit 8664118

Please sign in to comment.