Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nounous-archives
CransTicket
Commits
efc13672
Commit
efc13672
authored
Feb 11, 2015
by
Daniel STAN
Browse files
dump_creds: ajoute mode debug
parent
6b74765a
Changes
2
Hide whitespace changes
Inline
Side-by-side
client.py
View file @
efc13672
...
...
@@ -11,12 +11,21 @@ import string
from
lc_ldap
import
crans_utils
CREDS
=
pika
.
credentials
.
PlainCredentials
(
'oie'
,
secrets
.
get
(
'rabbitmq_oie'
),
True
)
import
sys
if
'--debug'
in
sys
.
argv
[
1
:]:
CREDS
=
pika
.
credentials
.
PlainCredentials
(
'rasputin'
,
secrets
.
get
(
'rabbitmq_rasputin'
),
True
)
PARAMS
=
pika
.
ConnectionParameters
(
host
=
'rabbitmq.crans.org'
,
port
=
5671
,
credentials
=
CREDS
,
ssl
=
True
)
rabbit_c
=
pika
.
BlockingConnection
(
PARAMS
)
ch
=
rabbit_c
.
channel
()
ch
.
queue_declare
(
'CransTicket'
)
if
'--debug'
in
sys
.
argv
[
1
:]:
QUEUE_NAME
=
'CransTicketDebug'
print
(
"Debug"
)
else
:
QUEUE_NAME
=
'CransTicket'
ch
.
queue_declare
(
QUEUE_NAME
)
def
gen_password
():
"""Génère un mot de passe aléatoire"""
...
...
@@ -62,7 +71,7 @@ class Ticket(object):
if
not
self
.
data
:
print
(
"Nothing to print !"
)
return
ch
.
basic_publish
(
exchange
=
''
,
routing_key
=
'CransTicket'
,
ch
.
basic_publish
(
exchange
=
''
,
routing_key
=
QUEUE_NAME
,
body
=
json
.
dumps
(
self
.
data
))
print
(
"Un nouveau ticket est en cours d'impression ..."
)
dump_creds.py
View file @
efc13672
...
...
@@ -23,6 +23,8 @@ for arg in sys.argv[1:]:
conf_wifi_only
=
False
elif
arg
==
'--pass'
:
conf_reset_password
=
True
elif
arg
==
'--debug'
:
pass
elif
arg
.
startswith
(
'--'
):
print
(
"Unknown arg"
)
exit
(
12
)
...
...
Write
Preview
Supports
Markdown
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