Fixing GUI packaging and web-socket code to allow onos-gui feature to load properly.
Change-Id: Idb3ed6ec1b96b3bfae75039de4644983ac4014bd
diff --git a/web/gui/BUILD b/web/gui/BUILD
index 44b292f..302e793 100644
--- a/web/gui/BUILD
+++ b/web/gui/BUILD
@@ -194,7 +194,7 @@
"""
osgi_jar_with_tests(
- name = "_onos-gui-base-jar",
+ name = "onos-gui-jar",
exclude_tests = [
"org.onosproject.ui.impl.AbstractUiImplTest",
"org.onosproject.ui.impl.topo.model.AbstractTopoModelTest",
@@ -227,7 +227,7 @@
name = "onos-gui",
srcs = [
":_onos-gui-npm-build",
- ":_onos-gui-base-jar",
+ ":onos-gui-jar",
":_root_level_files",
":_web_inf_classes_files",
":_raw_classes_files",
@@ -243,7 +243,7 @@
" for i in $(locations :_web_inf_classes_files); do cp $$ROOT/$$i ./WEB-INF/classes/; done &&" +
" mkdir ./WEB-INF/classes/raw && " +
" for i in $(locations :_raw_classes_files); do cp $$ROOT/$$i ./WEB-INF/classes/raw/; done &&" +
- " jar xf $$ROOT/$(location :_onos-gui-base-jar) &&" +
+ " jar xf $$ROOT/$(location :onos-gui-jar) &&" +
" find . -type f -exec touch -t 201806280000 {} \; &&" +
" jar cmf META-INF/MANIFEST.MF $$ROOT/$@ .",
output_to_bindir = 1,
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java
index 040e98a..8d5d1c9 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java
@@ -124,7 +124,7 @@
}
// FIXME: This should not be necessary
- private static final String FAKE_USERNAME = "UI-user";
+ private static final String FAKE_USERNAME = "unknown";
public class UiWebSocketCreator implements WebSocketCreator {
@Override
@@ -136,6 +136,7 @@
UiWebSocket socket = new UiWebSocket(directory, userName);
sockets.add(socket);
+ return socket;
}
return null;
}