Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nirina Malard
slapos
Commits
771bc9ca
Commit
771bc9ca
authored
Aug 17, 2023
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
0d38b560
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+2
-2
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+2
-2
software/ors-amarisoft/lopcomm-rrh-software.jinja2.py
software/ors-amarisoft/lopcomm-rrh-software.jinja2.py
+8
-8
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
771bc9ca
...
...
@@ -36,11 +36,11 @@ md5sum = b34fe47a73890097fbc6ea6374aeb38d
[lopcomm-rrh-software.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-software.jinja2.py
md5sum = 4
eb02bab7ba6a7a482c2b9bad0a3c084
md5sum = 4
d43bd9e7e4c8f07078e1e1b2b732dc2
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
ad247f0ef9bc1ffd28fe2abee1cf6ed8
md5sum =
c45c582a72bf6a0666dc64e24c79774f
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
771bc9ca
...
...
@@ -276,13 +276,13 @@ output = ${directory:script}/lopcomm-rrh-config.py
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/lopcomm-rrh-software.log
software-
json-log-output = ${directory:var}/log/lopcomm-rrh-software
.json.log
software-
output-json-log-output = ${directory:var}/log/lopcomm-rrh-software-output
.json.log
context =
section directory directory
section slap_configuration slap-configuration
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
key software_
json_log_file :software
-json-log-output
key software_
output_json_log_file :software-output
-json-log-output
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
raw software_install_template {{ software_install_template }}
...
...
software/ors-amarisoft/lopcomm-rrh-software.jinja2.py
View file @
771bc9ca
...
...
@@ -15,22 +15,22 @@ class LopcommNetconfClient:
def
__init__
(
self
):
log_file
=
"{{ log_file }}"
software_
json_log_file
=
"{{ software
_json_log_file }}"
software_
output_json_log_file
=
"{{ software_output
_json_log_file }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
software_
json_logger
=
logging
.
getLogger
(
'software
_json_logger'
)
self
.
software_
output_json_logger
=
logging
.
getLogger
(
'software_output
_json_logger'
)
self
.
logger
.
setLevel
(
logging
.
DEBUG
)
self
.
software_json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
software_
output_
json_logger
.
setLevel
(
logging
.
DEBUG
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
self
.
logger
.
addHandler
(
handler
)
formatter
=
logging
.
Formatter
(
"%(asctime)s [%(levelname)s] %(message)s"
)
handler
.
setFormatter
(
formatter
)
software_
json_handler
=
RotatingFileHandler
(
software
_json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
software_json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
software_
json_handler
.
setFormatter
(
software
_json_formatter
)
self
.
software_
json_logger
.
addHandler
(
software
_json_handler
)
software_
output_json_handler
=
RotatingFileHandler
(
software_output
_json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
software_
output_
json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
software_
output_json_handler
.
setFormatter
(
software_output
_json_formatter
)
self
.
software_
output_json_logger
.
addHandler
(
software_output
_json_handler
)
if
{{
testing
}}:
return
...
...
@@ -88,7 +88,7 @@ if __name__ == '__main__':
if
reply_xml
is
not
None
:
# Process and log the reply XML as needed
data_dict
xmltodict
.
parse
(
reply_xml
.
_raw
)
self
.
software_json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})(
reply_xml
)
self
.
software_
output_
json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})(
reply_xml
)
break
except
Exception
as
e
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment