foreman_xen 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2df01d8a9f3e43bd910e4597a70b24e38f6dd7d9
4
- data.tar.gz: b6707ccb696495513f969f8168e27f7dd8a3456a
3
+ metadata.gz: 71c64d229b548689dcbf45ef493820fd716f92e5
4
+ data.tar.gz: 51fb7425447a3c4a634117220cc5fb7fe9977f8a
5
5
  SHA512:
6
- metadata.gz: 7a9bf52e332b9413d0b2502b4d41c921ebaa20af439f5257afcbcadbdb8bc40433d61b76db6ef31279d8fc0ce3aea7fc4aad46ff5f1e0d3b3ffa9931e036d9c0
7
- data.tar.gz: 2138939601ccad3c2950061173ee665e416c89c651f0a47ad1b07d8b18a0e74d958b5ea9893f4084df2658a8a908ef2f298e71a2113049783a09d52a6a87d4bb
6
+ metadata.gz: c9bebfa016325fd8f0875e2d07fe60fdde95bcc27adfff0de0f7c05d5cd9949990c0a046109112767f4e1cf71c419ef7f49a25c5d7ce548ea930f8c71c9d9590
7
+ data.tar.gz: 63ab48377088db4916ea6e3eb5efb50ca60461bc8ffd278e249e44a4565c3ef53c2796f165c77ac3f67fc40761974fba2f7f49778723c048d02cf3eeaf51d9d7
@@ -41,23 +41,19 @@ module XenComputeHelper
41
41
  attribute_map[:memory_min] = compute_attributes['memory_min'] ? compute_attributes['memory_min'] : nil
42
42
  attribute_map[:memory_max] = compute_attributes['memory_max'] ? compute_attributes['memory_max'] : nil
43
43
  attribute_map[:power_on] = compute_attributes['start'] ? compute_attributes['start'] : nil
44
- elsif params && params['host'] && params['host']['compute_attributes']
45
- if params['host']['compute_attributes']['VBDs']
46
- attribute_map[:volume_size] = (params['host']['compute_attributes']['VBDs']['physical_size']) ? params['host']['compute_attributes']['VBDs']['physical_size'] : nil
47
- attribute_map[:volume_selected] = (params['host']['compute_attributes']['VBDs']['sr_uuid']) ? params['host']['compute_attributes']['VBDs']['sr_uuid'] : nil
48
- end
49
- if params['host']['compute_attributes']['VIFs']
50
- attribute_map[:network_selected] = params['host']['compute_attributes']['VIFs']['print'] ? params['host']['compute_attributes']['VIFs']['print'] : nil
51
- end
52
- attribute_map[:template_selected_custom] = params['host']['compute_attributes']['custom_template_name'] ? params['host']['compute_attributes']['custom_template_name'] : nil
53
- attribute_map[:template_selected_builtin] = params['host']['compute_attributes']['builtin_template_name'] ? params['host']['compute_attributes']['builtin_template_name'] : nil
54
44
  elsif new
45
+ attribute_map[:cpu_count] = new.vcpus_max ? new.vcpus_max : nil
46
+ attribute_map[:memory_min] = new.memory_static_min ? new.memory_static_min : nil
47
+ attribute_map[:memory_max] = new.memory_static_max ? new.memory_static_max : nil
55
48
  if new.__vbds
56
- attribute_map[:volume_selected] = new.__vbds['sr_uuid'] ? new.__vbds['sr_uuid'] : nil
57
- attribute_map[:volume_size] = new.__vbds['physical_size'] ? new.__vbds['physical_size'] : nil
49
+ vdi = new.vbds.first.vdi
50
+ if vdi
51
+ attribute_map[:volume_selected] = vdi.sr.uuid ? vdi.sr.uuid : nil
52
+ attribute_map[:volume_size] = vdi.virtual_size ? (vdi.virtual_size.to_i / 1073741824).to_s : nil
53
+ end
58
54
  end
59
55
  if new.__vifs
60
- attribute_map[:network_selected] = new.__vifs['print'] ? new.__vifs['print'] : nil
56
+ attribute_map[:network_selected] = new.networks.first.name ? new.networks.first.name : nil
61
57
  end
62
58
  end
63
59
  attribute_map
@@ -7,7 +7,6 @@
7
7
  end
8
8
 
9
9
  if controller_name == 'hosts'
10
- compute_attributes = compute_resource.compute_profile_attributes_for(params['host']['compute_profile_id'])
11
10
  fields_enabled = true
12
11
  start_enable = true
13
12
  elsif controller_name == 'compute_attributes'
@@ -74,7 +73,7 @@
74
73
  <!-- Startup -->
75
74
  <div class="children_fields" id="xenserver-vm-start" style="<%= hide_raw %>">
76
75
  <%= field_set_tag 'VM Startup Options', :id => 'vm_starup_options', :title => _('Power ON VM') do -%>
77
- <%= checkbox_f f, :start, :checked => (compute_attributes['start'] == '1' || start_enable), :label => _("Power ON VM") %>
76
+ <%= checkbox_f f, :start, :checked => (attribute_map[:power_on] == '1' || start_enable), :label => _("Power ON VM") %>
78
77
  <% end -%>
79
78
  </div>
80
79
 
@@ -1,3 +1,3 @@
1
1
  module ForemanXen
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_xen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Nemirovsky, Michal Piotrowski, Avi Israeli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake