Added tests for kwarg required parameters when calling create_node

Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/96f03c7c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/96f03c7c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/96f03c7c

Branch: refs/heads/trunk
Commit: 96f03c7cdd6d960431efc03d789ae7a8d503ee27
Parents: 3a1d40b
Author: davidcrossland <[email protected]>
Authored: Mon Jun 30 10:47:15 2014 +0100
Committer: Michael Bennett <[email protected]>
Committed: Wed Nov 19 13:03:14 2014 -0500

----------------------------------------------------------------------
 libcloud/compute/drivers/azure.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/96f03c7c/libcloud/compute/drivers/azure.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure.py 
b/libcloud/compute/drivers/azure.py
index 44d0b33..6154fb3 100644
--- a/libcloud/compute/drivers/azure.py
+++ b/libcloud/compute/drivers/azure.py
@@ -414,7 +414,7 @@ class AzureNodeDriver(NodeDriver):
             ex_deployment_slot = kwargs['ex_deployment_slot']
         else:
             # We assume production if this is not provided.
-            ex_deployment_slot = "production"
+            ex_deployment_slot = "Production"
 
         if "ex_admin_user_id" in kwargs:
             ex_admin_user_id = kwargs['ex_admin_user_id']
@@ -422,6 +422,24 @@ class AzureNodeDriver(NodeDriver):
             # This mimics the Azure UI behavior.
             ex_admin_user_id = "azureuser"
 
+        if "ex_storage_service_name" not in kwargs:
+            raise ValueError("ex_storage_service_name is required.")
+
+        if "size" not in kwargs:
+            raise ValueError("size is required. ")
+
+        if "image" not in kwargs:
+            raise ValueError("image is required.")
+
+        if "name" not in kwargs:
+            raise ValueError("name is required.")
+
+        if "ex_admin_user_id" not in kwargs:
+            raise ValueError("ex_cloud_service_name is required.")
+
+        if "ex_admin_user_id" not in kwargs:
+            raise ValueError("ex_cloud_service_name is required.")
+
         node_list = 
self.list_nodes(ex_cloud_service_name=ex_cloud_service_name)
         network_config = ConfigurationSet()
         network_config.configuration_set_type = 'NetworkConfiguration'

Reply via email to