Customer bug-fixes:
Rolling back the server-side preference setting for GUI
Fixing onos-log-query
Closing UiWebSocket on non-auth message detection
Change-Id: Icf9155668643bd0fcb2e87807364e7304ce21d53
diff --git a/tools/package/runtime/bin/onos-log-query b/tools/package/runtime/bin/onos-log-query
index 56ed544..5f45375 100755
--- a/tools/package/runtime/bin/onos-log-query
+++ b/tools/package/runtime/bin/onos-log-query
@@ -25,13 +25,14 @@
}
name=query # default name
+onlyts=0
while getopts n:f:t:x?h o; do
case "$o" in
n) name="$OPTARG";;
f) from="$OPTARG";;
t) to="$OPTARG";;
- x) nostt=1;;
+ x) onlyts=1;;
*) usage;;
esac
done
@@ -42,14 +43,16 @@
[ "$name" = "karaf" ] && echo "Name cannot be karaf" && usage
function stitchLogs {
- awk -v from="${from}" -v to="${to}" -v nostt=${nostt:-0} \
+ awk -v from="${from}" -v to="${to}" -v onlyts=${onlyts} \
-v TS="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3}" '
+ BEGIN { on = 0; FS="|"; }
TS {
on = (from == "" || $1 >= from) && (to == "" || $1 <= to);
- if (on) { print $0; next; }
+ if (on) { print $0; }
+ next;
}
- { if (on && !nostt) { print $0; } }
- ' FS='|' $(ls -r1 karaf.log*) > ${name}.log
+ { if (on && !onlyts) { print $0; } }
+ ' $(ls -r1 karaf.log*) > ${name}.log
}
function stitchNodeLogs {
@@ -59,12 +62,12 @@
}
if [ $# -eq 1 -a -d "$1" ]; then
- stitchNodeLogs $1 && cat $1/${name}.log
+ stitchNodeLogs $1
elif [ $# -ge 1 ]; then
echo "No node directory for $1" >&2
usage
elif ls karaf.log &>/dev/null; then
- stitchLogs && cat ${name}.log
+ stitchLogs
elif ls */karaf.log &>/dev/null; then
for node in $(ls */karaf.log | cut -d/ -f1); do
stitchNodeLogs $node &
@@ -72,5 +75,4 @@
wait
awk '{ print FILENAME " | " $0; }' */${name}.log | \
sed "s:/${name}.log::" | sort -t\| -k2,2 > ${name}.log
- cat ${name}.log
fi
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
index 32f4981..4d01f8c 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
@@ -349,7 +349,8 @@
private void authenticate(String type, ObjectNode message) {
if (!AUTHENTICATION.equals(type)) {
- log.warn("Non-Authenticated Web Socket: {}", message);
+ log.warn("WebSocket not authenticated: {}", message);
+ close();
return;
}
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index eac9ecd..ab803f6 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -529,9 +529,9 @@
function applyPreferences(evt) {
// var zoomPrefs = ps.getPrefs('topo_zoom', null);
- if (ps.getPrefs('topo_prefs', null)) {
- restoreConfigFromPrefs();
- }
+// if (ps.getPrefs('topo_prefs', null)) {
+// restoreConfigFromPrefs();
+// }
// if (zoomPrefs) {
// $log.debug('TOPO- Zoom State:', zoomPrefs);
// zoomer.panZoom([zoomPrefs.tx, zoomPrefs.ty], zoomPrefs.sc, 100);