generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proxy installation status and translation support (#318)
Add proxy installation status and translation support NethServer/dev#7057
- Loading branch information
Showing
5 changed files
with
129 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# | ||
# Copyright (C) 2022 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
import json | ||
import sys | ||
import agent | ||
|
||
rdb = agent.redis_connect(privileged=True) | ||
|
||
# Find default proxy instance for current node | ||
proxy_id = agent.resolve_agent_id('nethvoice-proxy@node') | ||
config = { | ||
"proxy_installed": True if proxy_id is not None else False, | ||
} | ||
|
||
json.dump(config, fp=sys.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Get the status of nethvoice proxy", | ||
"$id": "http://nethserver.org/json-schema/task/output/nethvoice/get-proxy-status", | ||
"description": "Get the status of nethvoice proxy", | ||
"examples": [ | ||
{ | ||
"proxy_installed": true | ||
} | ||
], | ||
"type": "object", | ||
"properties": { | ||
"proxy_installed": { | ||
"description": "Test if the Nethvoice proxy is installed", | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": ["proxy_installed"], | ||
"additionalProperties": false | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/10_nethvoice_actions/10_get_proxy_status_integrations.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*** Settings *** | ||
Library SSHLibrary | ||
Resource ../api.resource | ||
|
||
*** Test Cases *** | ||
Check get-proxy-status action output | ||
${response} = Run task module/${module_id}/get-proxy-status {} | ||
Should Be Equal As Strings ${response['proxy_installed']} True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters