Class: Staypuft::Deployment::NovaService
Defined Under Namespace
Modules: NetworkManager, PrivateFixedRange, PublicFloatingRange, VlanRange
Classes: Jail, NetworkRangesValidator, NovaVlanRangeValidator
Constant Summary
collapse
- VLAN_HELP =
Deployment::NeutronService::VLAN_HELP
Instance Attribute Summary
#deployment
Class Method Summary
collapse
Instance Method Summary
collapse
#attributes=, #hostgroup, #initialize, #marked_for_destruction?
#param_attr, #param_attr_array, #param_scope
Class Method Details
.param_scope ⇒ Object
3
4
5
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 3
def self.param_scope
'nova'
end
|
Instance Method Details
#active? ⇒ Boolean
92
93
94
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 92
def active?
deployment.networking == Deployment::Networking::NOVA
end
|
#network_overrides ⇒ Object
100
101
102
103
104
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 100
def network_overrides
{ 'force_dhcp_release' => false }.tap do |h|
h.update 'vlan_start' => vlan_start if self.vlan_manager?
end.to_yaml
end
|
#num_networks ⇒ Object
114
115
116
117
118
119
120
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 114
def num_networks
if self.vlan_manager?
vlan_range_arr[1].to_i - vlan_range_arr[0].to_i + 1
else
1
end
end
|
#param_hash ⇒ Object
122
123
124
125
126
127
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 122
def param_hash
{ 'network_manager' => network_manager,
'vlan_range' => vlan_range,
'public_floating_range' => public_floating_range,
'private_fixed_range' => private_fixed_range }
end
|
#set_defaults ⇒ Object
88
89
90
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 88
def set_defaults
self.network_manager = NetworkManager::FLAT_DHCP
end
|
#vlan_manager? ⇒ Boolean
96
97
98
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 96
def vlan_manager?
self.network_manager == NetworkManager::VLAN
end
|
#vlan_range_arr ⇒ Object
106
107
108
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 106
def vlan_range_arr
arr = self.vlan_range.split(':')
end
|
#vlan_start ⇒ Object
110
111
112
|
# File 'app/models/staypuft/deployment/nova_service.rb', line 110
def vlan_start
vlan_range_arr[0]
end
|