Skip to content

Commit

Permalink
Merge pull request #66 from cloudify-incubator/1.4.3
Browse files Browse the repository at this point in the history
adding input args to vm
  • Loading branch information
EarthmanT authored Dec 25, 2017
2 parents c349fbe + 4c6bd20 commit 132afdb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cloudify_azure/resources/compute/virtualmachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ def vm_name_generator():


@operation
def create(**_):
def create(args=None, **_):
'''Uses an existing, or creates a new, Virtual Machine'''
# Generate a resource name (if needed)
utils.generate_resource_name(
VirtualMachine(),
generator=vm_name_generator)
res_cfg = utils.get_resource_config() or dict()
res_cfg = utils.get_resource_config(args=args) or dict()
# Build storage profile
osdisk = build_osdisk_profile(
res_cfg.get('storageProfile', dict()).get('osDisk', dict()))
Expand Down Expand Up @@ -237,7 +237,7 @@ def create(**_):
'tags': ctx.node.properties.get('tags'),
'plan': ctx.node.properties.get('plan'),
'properties': utils.dict_update(
utils.get_resource_config(),
utils.get_resource_config(args=args),
{
'availabilitySet': utils.get_rel_id_reference(
AvailabilitySet,
Expand Down
4 changes: 2 additions & 2 deletions cloudify_azure/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ def task_resource_delete(resource, name=None, _ctx=ctx):
resource.delete(name)


def get_resource_config(_ctx=ctx):
def get_resource_config(_ctx=ctx, args=None):
'''
Loads the resource config parameters and converts
unicode key/value pairs for use with *requests*
:returns: Resource config parameters
:rtype: dict
'''
return _ctx.node.properties.get('resource_config')
return args if args else _ctx.node.properties.get('resource_config')


def get_resource_name_ref(rel, prop=None, _ctx=ctx):
Expand Down
4 changes: 2 additions & 2 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
plugins:
pkg:
executor: central_deployment_agent
source: https://github.com/cloudify-cosmo/cloudify-azure-plugin/archive/master.zip
source: https://github.com/cloudify-cosmo/cloudify-azure-plugin/archive/1.4.3.zip
package_name: cloudify-azure-plugin
package_version: '1.4.2'
package_version: '1.4.3'

data_types:
cloudify.datatypes.azure.Config:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='cloudify-azure-plugin',
version='1.4.2',
version='1.4.3',
license='LICENSE',
packages=[
'cloudify_azure',
Expand Down

0 comments on commit 132afdb

Please sign in to comment.