Permalink
Browse files

Fix setting of user data

  • Loading branch information...
1 parent 182633b commit 61fb982160147ae13c676cfc4ec49a5a69c8d088 @priteau priteau committed Jan 16, 2013
Showing with 8 additions and 1 deletion.
  1. +2 −0 phantomweb/static/js/phantom_lc.js
  2. +6 −1 phantomweb/workload.py
View
2 phantomweb/static/js/phantom_lc.js
@@ -292,6 +292,7 @@ function phantom_lc_save_click_internal() {
var instance_type_key = site_name.concat(".").concat("instance_type");
var max_vm_key = site_name.concat(".").concat("max_vm");
var common_key = site_name.concat(".").concat("common");
+ var user_data_key = site_name.concat(".").concat("user_data");
var ndx = i + 1;
@@ -301,6 +302,7 @@ function phantom_lc_save_click_internal() {
data[instance_type_key] = cloud_data["instance_type"];
data[max_vm_key] = cloud_data["max_vm"];
data[common_key] = cloud_data["common"];
+ data[user_data_key] = cloud_data["user_data"];
});
var success_func = function(obj) {
View
7 phantomweb/workload.py
@@ -472,6 +472,7 @@ def phantom_lc_save(request_params, userobj):
_parse_param_name("max_vm", param_name, request_params, lc_dict)
_parse_param_name("common", param_name, request_params, lc_dict)
_parse_param_name("rank", param_name, request_params, lc_dict)
+ _parse_param_name("user_data", param_name, request_params, lc_dict)
lc_db_object = LaunchConfigurationDB.objects.filter(name=lc_name, username=userobj._user_dbobject.access_key)
if not lc_db_object:
@@ -511,7 +512,11 @@ def phantom_lc_save(request_params, userobj):
except Exception, boto_del_ex:
# delete in case this is an update
pass
- lc = boto.ec2.autoscale.launchconfig.LaunchConfiguration(phantom_con, name=lc_conf_name, image_id=entry['image_id'], key_name=site_ent.keyname, security_groups=['default'], instance_type=entry['instance_type'])
+ lc = boto.ec2.autoscale.launchconfig.LaunchConfiguration(phantom_con,
+ name=lc_conf_name, image_id=entry['image_id'],
+ key_name=site_ent.keyname, security_groups=['default'],
+ instance_type=entry['instance_type'],
+ user_data=entry['user_data'])
phantom_con.create_launch_configuration(lc)
is_common = entry['common'].lower() == "true"

0 comments on commit 61fb982

Please sign in to comment.