This is an automated email from the ASF dual-hosted git repository.
bhaisaab pushed a commit to branch 4.9
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.9 by this push:
new 86b6050 CLOUDSTACK-10042: Properly show ICMP SecGroup Rules (#2233)
86b6050 is described below
commit 86b6050c322aeb881d68e2235ee91fecbd1d974b
Author: Wido den Hollander <[email protected]>
AuthorDate: Thu Aug 10 01:03:35 2017 +0200
CLOUDSTACK-10042: Properly show ICMP SecGroup Rules (#2233)
A simple if-statement would fail if either the type or code were 0
as that if-statement failed them.
By checking if they are defined and casting them to a String afterwards
this makes the if-statement properly resolve and show the rule as it should.
Signed-off-by: Wido den Hollander <[email protected]>
---
ui/scripts/network.js | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 569e31d..6b9257a 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -26,11 +26,19 @@
tags: elem.tags
};
+ if (typeof elem.icmptype != 'undefined') {
+ var icmptype = elem.icmptype.toString()
+ }
+
+ if (typeof elem.icmpcode != 'undefined') {
+ var icmpcode = elem.icmpcode.toString()
+ }
+
if (elemData.startport == 0 && elemData.endport) {
elemData.startport = '0';
- } else if (elem.icmptype && elem.icmpcode) {
- elemData.startport = elem.icmptype;
- elemData.endport = elem.icmpcode;
+ } else if (icmptype && icmpcode) {
+ elemData.startport = icmptype;
+ elemData.endport = icmpcode;
}
return elemData;
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].