B #5053: fireedge_key for guacamole (#330)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>

Co-authored-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Miguel Lobo EscalonaandJorge Lobo authored and GitHub committed 2020-10-19 15:43:49 +02:00
1 parent 37855112f2
commit b173d91a05
1 file changed
+3 -2
+3 -2
View File
@@ -87,7 +87,8 @@ const genFireedgeKey = () => {
if (global && !global.FIREEDGE_KEY) {
const { v4 } = require('uuid')
let uuidv4 = v4()
if (global.FIREEDGE_KEY_PATH) {
if (global.FIREEDGE_KEY_PATH && uuidv4) {
uuidv4 = uuidv4.replace(/-/g, "").toUpperCase()
existsFile(
global.FIREEDGE_KEY_PATH,
filedata => {
@@ -97,7 +98,7 @@ const genFireedgeKey = () => {
},
() => {
createFile(
global.FIREEDGE_KEY_PATH, uuidv4, () => undefined, err => {
global.FIREEDGE_KEY_PATH, uuidv4.replace(/-/g, ""), () => undefined, err => {
const config = {
color: 'red',
message: 'Error: %s',