commit/galaxy-central: dannon: CloudLaunch: Add password confirm field to cloudlaunch to prevent accidentally not knowing your password during presentations.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/53c2605a8ca2/ changeset: 53c2605a8ca2 user: dannon date: 2012-10-17 19:25:29 summary: CloudLaunch: Add password confirm field to cloudlaunch to prevent accidentally not knowing your password during presentations. Actually display errormessage box to show issues. affected #: 2 files diff -r a70bb556b9a5458a878e8abef7a55c88e2f0e058 -r 53c2605a8ca2fa8086c5c6da3bbbfacd37737510 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py --- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py +++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py @@ -61,7 +61,7 @@ # We need to get persistent data, and the cluster name. for key in bucket.list(): if key.name.endswith('.clusterName'): - clusters.append({'name':key.name.split('.clusterName')[0], 'persistent_data': pd.get_contents_as_string()}) + clusters.append({'name': key.name.split('.clusterName')[0], 'persistent_data': pd.get_contents_as_string()}) account_info['clusters'] = clusters return to_json_string(account_info) @@ -76,13 +76,13 @@ except EC2ResponseError, err: ec2_error = err.error_message if ec2_error: - #return trans.fill_template("cloud/run.mako", error = ec2_error) - return {'errors':[ec2_error]} + trans.response.status = 400 + return ec2_error else: - user_provided_data={'cluster_name':cluster_name, - 'access_key':key_id, - 'secret_key':secret, - 'instance_type':instance_type} + user_provided_data = {'cluster_name': cluster_name, + 'access_key': key_id, + 'secret_key': secret, + 'instance_type': instance_type} if password: user_provided_data['password'] = password if share_string: @@ -95,15 +95,13 @@ instance = rs.instances[0] ct = 0 while not instance.public_dns_name: - # Can take a second to have public dns name registered. - # DBTODO, push this into a page update, this is not ideal. try: instance.update() except EC2ResponseError: - #This can happen when update is invoked before the instance is fully registered. Prevent - #failure, wait it out. + #This can happen when update is invoked before the instance is fully registered. + #Prevent failure, wait it out. pass - ct +=1 + ct += 1 time.sleep(1) if kp_material: #We have created a keypair. Save to tempfile for one time retrieval. @@ -123,7 +121,8 @@ 'kp_material_tag':kp_material_tag }) else: - return {'errors':["Instance failure, but no specific error was detected. Please check your AWS Console."]} + trans.response.status = 400 + return "Instance failure, but no specific error was detected. Please check your AWS Console." @web.expose def get_pkey(self, trans, kp_material_tag=None): diff -r a70bb556b9a5458a878e8abef7a55c88e2f0e058 -r 53c2605a8ca2fa8086c5c6da3bbbfacd37737510 templates/cloud/index.mako --- a/templates/cloud/index.mako +++ b/templates/cloud/index.mako @@ -113,9 +113,16 @@ type: 'POST', dataType: 'json', beforeSubmit: function(data){ - //Hide the form, show pending box with spinner. - $('#launchFormContainer').hide('fast'); - $('#responsePanel').show('fast'); + if ($('#id_password').val() != $('#id_password_confirm').val()){ + //Passwords don't match. + $('#cloudlaunch_form').prepend('<div class="errormessage">Passwords do not match</div>'); + return false; + }else{ + $('.errormessage').remove() + //Hide the form, show pending box with spinner. + $('#launchFormContainer').hide('fast'); + $('#responsePanel').show('fast'); + } }, success: function(data){ //Success Message, link to key download if required, link to server itself. @@ -144,6 +151,9 @@ $('#instance_dns').text(data.public_dns_name); $('#launchSuccess').show('fast'); } + }, + error: function(data){ + $('#cloudlaunch_form').prepend('<div class="errormessage">' + data.responseText + '</div>'); } }); }); @@ -201,6 +211,12 @@ </div><div class="form-row"> + <label for="id_password_confirm">Cluster Password - Confirmation</label> + <input type="password" size="40" name="password_confirm" id="id_password_confirm"/><br/> + </div> + + + <div class="form-row"><label for="id_keypair">Key Pair</label><select name="keypair" id="id_keypair"><option name="Create" value="cloudman_keypair">cloudman_keypair</option> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket