foreman_xen 0.1.4 → 0.1.5

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: bf86d445212406a7e6272d38901bbf3775dabae3
4
- data.tar.gz: f8fcff62613110e76de79caebed200cb3b210293
3
+ metadata.gz: c50ccd826ef2ecbcf80ba0e0a30d20386b1866c2
4
+ data.tar.gz: 4b917f127777166ba7f1811815c5d31efc840df5
5
5
  SHA512:
6
- metadata.gz: 6baec9017286dbfcd59f5ed4a1a4bc9898ce5d0c4077748fc5e349c724481614b618d0126ddd4533d68b4d062ab2313d164b60b36aa1e2ac58f07c79069190f4
7
- data.tar.gz: 3e6f83333a0912229e3ef87a2b1f9feb21be179f4b05e9843d7aeed82422cfd6a3125abcc47dbd297d6a852e4980dd9080c71e8bf708af158303bd4dbc22ff8e
6
+ metadata.gz: eef516f319dd09e05b4741d6e87be4d88fd18f258889cbeeb5b5b3fd0a7cb5b7e34194634d6ee90c39b307b3aedc1636356c7d28a07f65698a0f0228d5b4bb36
7
+ data.tar.gz: 3f53be8b059ff013e13660db23774cb215534aac874a760133a0ca7b33cd81e661d73c6ef44f2c804320a9d4b4492ca49f1da33805cb6a34825eeeb4f46f45a7
@@ -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.1.4"
2
+ VERSION = "0.1.5"
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.1.4
4
+ version: 0.1.5
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