1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Typo, change GBs units to GB

This commit is contained in:
Carlos Martín 2015-08-07 16:09:46 +02:00
parent 77fcdd026c
commit 21a72c51d3
6 changed files with 49 additions and 28 deletions

View File

@ -75,7 +75,7 @@
<div class="row">
<div class="large-12 large-centered columns">
<h5 class="subheader text-right">
<span class="left" style="margin-bottom: 0.5em">{{tr "Memory (GBs)"}}</span>
<span class="left" style="margin-bottom: 0.5em">{{tr "Memory (GB)"}}</span>
</h5>
</div>
</div>

View File

@ -94,7 +94,7 @@ define(function(require){
diskContext.data('original_size', sizeGB);
RangeSlider.insert({
'label': disk.IMAGE,
'unitLabel': 'GBs',
'unitLabel': 'GB',
'name': 'SIZE',
'start': sizeGB,
'end': sizeGB + 500,

View File

@ -23,6 +23,8 @@ else
ZENDESK_API_GEM = true
end
require 'pp'
helpers do
def zendesk_client
client = ZendeskAPI::Client.new do |config|
@ -62,8 +64,17 @@ helpers do
# When getting the error 'hostname does not match the server certificate'
# use the API at https://yoursubdomain.zendesk.com/api/v2
end
if client.current_user.nil? || client.current_user.id.nil?
=begin
`echo 'vvvvv zendesk_client vvvvv' >> /tmp/carlos`
`echo 'client.current_user #{client.current_user}' >> /tmp/carlos`
`echo '' >> /tmp/carlos`
`echo 'client.current_user.nil? || client.current_user.id.nil? #{(client.current_user.nil? || client.current_user.id.nil?).to_s}' >> /tmp/carlos`
`echo 'client.current_user.created_at.nil? #{client.current_user.created_at.nil?}' >> /tmp/carlos`
`echo 'client.current_user.created_at #{client.current_user.created_at}' >> /tmp/carlos`
`echo 'client.current_user.created_at.class #{client.current_user.created_at.class}' >> /tmp/carlos`
`echo '~~~~~ zendesk_client ~~~~~' >> /tmp/carlos`
=end
if client.current_user.nil? || client.current_user.id.nil? || client.current_user.created_at.nil?
error 401, "Zendesk account credentials are incorrect"
else
return client
@ -71,8 +82,18 @@ helpers do
end
def zrequest_to_one(zrequest)
`echo 'vvvvv zrequest_to_one vvvvv' >> /tmp/carlos`
`echo '' >> /tmp/carlos`
`echo 'zrequest #{zrequest}' >> /tmp/carlos`
`echo 'zrequest.id #{zrequest.id}' >> /tmp/carlos`
`echo 'zrequest.comments #{zrequest.comments}' >> /tmp/carlos`
`echo 'zrequest.comments.count #{zrequest.comments.count}' >> /tmp/carlos`
`echo 'zrequest.comments.class #{zrequest.comments.class}' >> /tmp/carlos`
#`echo '~~~~~ zrequest_to_one ~~~~~' >> /tmp/carlos`
one_zrequest = {
"id" => zrequest.id,
"id" => zrequest.id, ### TODO: .id in 1.8.7 fails!!
"url" => zrequest.url,
"subject" => zrequest.subject,
"description" => zrequest.description,
@ -83,7 +104,7 @@ helpers do
}
zrequest.custom_fields.each { |field|
case field.id
case field.id ### TODO: .id in 1.8.7 fails!!
when 391130
one_zrequest["opennebula_version"] = field.value
when 391197
@ -91,8 +112,15 @@ helpers do
end
}
`echo 'each comment' >> /tmp/carlos`
zrequest.comments.each{ |comment|
`echo 'comment #{comment}' >> /tmp/carlos`
}
if zrequest.comments
comment = zrequest.comments.delete_at(0)
`echo '#0 comment #{comment}' >> /tmp/carlos`
one_zrequest["html_description"] = comment.html_body
zrequest.comments.each{ |comment|

View File

@ -97,9 +97,9 @@ http://*)
ORIGINAL_SIZE=${ORIGINAL_SIZE:-0}
if [ "$SIZE" -ge "$ORIGINAL_SIZE" ]; then
RESIZE_CMD="; qemu-img resize ${DST_PATH} ${SIZE}M"
fi
# if [ "$SIZE" -ge "$ORIGINAL_SIZE" ]; then
# RESIZE_CMD="; qemu-img resize ${DST_PATH} ${SIZE}M"
# fi
CLONE_CMD="cd ${DST_DIR}; \
cp ${SRC_PATH} ${DST_PATH} \

View File

@ -68,6 +68,8 @@ EOF
log "Copying $SRC_PATH to datastore as $DST_PATH"
sleep 10
ssh_exec_and_log $SRC_HOST "$CPSCRIPT" "Could not copy image $DST_PATH"
exit 0

View File

@ -3355,8 +3355,6 @@ int VirtualMachine::set_saveas_disk(int disk_id, const string& source, int iid)
int VirtualMachine::set_saveas_state()
{
string s;
switch (state)
{
case ACTIVE:
@ -3365,25 +3363,23 @@ int VirtualMachine::set_saveas_state()
return -1;
}
lcm_state = HOTPLUG_SAVEAS;
set_state(HOTPLUG_SAVEAS);
break;
case POWEROFF:
state = ACTIVE;
lcm_state = HOTPLUG_SAVEAS_POWEROFF;
set_state(ACTIVE);
set_state(HOTPLUG_SAVEAS_POWEROFF);
break;
case SUSPENDED:
state = ACTIVE;
lcm_state = HOTPLUG_SAVEAS_SUSPENDED;
set_state(ACTIVE);
set_state(HOTPLUG_SAVEAS_SUSPENDED);
break;
default:
return -1;
}
log("VM", Log::INFO, "New state is " + lcm_state_to_str(s,lcm_state));
return 0;
}
@ -3392,25 +3388,20 @@ int VirtualMachine::set_saveas_state()
int VirtualMachine::clear_saveas_state()
{
string s;
switch (lcm_state)
{
case HOTPLUG_SAVEAS:
lcm_state = RUNNING;
log("VM", Log::INFO, "New state is "+lcm_state_to_str(s,lcm_state));
set_state(RUNNING);
break;
case HOTPLUG_SAVEAS_POWEROFF:
state = POWEROFF;
lcm_state = LCM_INIT;
log("VM", Log::INFO, "New state is " + vm_state_to_str(s,state));
set_state(POWEROFF);
set_state(LCM_INIT);
break;
case HOTPLUG_SAVEAS_SUSPENDED:
state = SUSPENDED;
lcm_state = LCM_INIT;
log("VM", Log::INFO, "New state is " + vm_state_to_str(s,state));
set_state(SUSPENDED);
set_state(LCM_INIT);
break;
default: