lib/cloudstack-cli/commands/port_rule.rb in cloudstack-cli-0.3.4 vs lib/cloudstack-cli/commands/port_rule.rb in cloudstack-cli-0.3.5
- old
+ new
@@ -16,9 +16,13 @@
project = client.get_project(project)
options[:rules].each do |pf_rule|
ip = pf_rule.split(":")[0]
if ip != ''
ip_addr = client.get_public_ip_address(ip)
+ unless ip_addr
+ say "Error: IP #{ip} not found.", :red
+ next
+ end
else
ip_addr = frontendip ||= client.associate_ip_address(
client.get_network(options[:network], project ? project["id"] : nil)["id"]
)
end
\ No newline at end of file