Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
e3f4a3d4
Commit
e3f4a3d4
authored
Nov 01, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed logger
parent
09fd2c95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
rpc_server.py
drip_planner2/src/rpc_server.py
+12
-3
No files found.
drip_planner2/src/rpc_server.py
View file @
e3f4a3d4
...
...
@@ -12,6 +12,15 @@ import json
from
planner.dump_planner
import
*
from
os.path
import
expanduser
logger
=
logging
.
getLogger
(
__name__
)
if
not
getattr
(
logger
,
'handler_set'
,
None
):
#logger.setLevel(logging.INFO)
h
=
logging
.
StreamHandler
()
formatter
=
logging
.
Formatter
(
'
%(asctime)
s -
%(name)
s -
%(levelname)
s -
%(message)
s'
)
h
.
setFormatter
(
formatter
)
logger
.
addHandler
(
h
)
logger
.
handler_set
=
True
def
init_chanel
(
args
):
...
...
@@ -30,7 +39,7 @@ def start(channel):
channel
.
basic_qos
(
prefetch_count
=
1
)
channel
.
basic_consume
(
on_request
,
queue
=
queue_name
)
print
(
" [x] Awaiting RPC requests"
)
logger
.
info
(
" [x] Awaiting RPC requests"
)
channel
.
start_consuming
()
def
on_request
(
ch
,
method
,
props
,
body
):
...
...
@@ -77,14 +86,14 @@ def handle_delivery(message):
parameter
[
'encoding'
]
=
'UTF-8'
response
[
"parameters"
]
.
append
(
parameter
)
print
(
"Output message:
%
s"
%
json
.
dumps
(
response
))
logger
.
info
(
"Output message:"
+
json
.
dumps
(
response
))
return
json
.
dumps
(
response
)
if
__name__
==
"__main__"
:
# home = expanduser("~")
# planner = DumpPlanner(home+"/workspace/DRIP/docs/input_tosca_files/BEIA_cardif2.yml")
# print planner.plan()
print
sys
.
argv
logger
.
info
(
"Input args: "
+
sys
.
argv
)
channel
=
init_chanel
(
sys
.
argv
)
global
queue_name
queue_name
=
sys
.
argv
[
2
]
...
...
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