lib/security.rb in forj-0.0.22 vs lib/security.rb in forj-0.0.23
- old
+ new
@@ -26,24 +26,26 @@
# SecurityGroup module
#
module SecurityGroup
def create_security_group(name)
+ sec_group = nil
begin
sec_groups = get_security_group(name)
if sec_groups.length >= 1
- sec_groups[0]
+ sec_group = sec_groups[0]
else
description = format('Security group for blueprint %{name}', name: name)
Logging.info(description)
- Connection.network.security_groups.create(
+ sec_group = Connection.network.security_groups.create(
:name => name,
:description => description
)
end
rescue => e
Logging.error(e.message)
end
+ sec_group
end
def delete_security_group(security_group)
begin
sec_group = get_security_group(security_group)