Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
dnsdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8e5ff8e5
authored
6 years ago
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-hostname-handling' into 'master'
dnscelery: fix hostname handling See merge request
!3
parents
db009ffc
5a7ecd47
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
dnscelery.py
+14
-3
No files found.
dnscelery.py
View file @
8e5ff8e5
from
os
import
getenv
,
path
from
argparse
import
ArgumentParser
import
subprocess
from
kombu
import
Queue
,
Exchange
from
socket
import
gethostname
from
celery
import
Celery
HOSTNAME
=
gethostname
()
parser
=
ArgumentParser
()
parser
.
add_argument
(
'-n'
,
'--hostname'
,
dest
=
'hostname'
,
help
=
'Define the full queue name with'
'with priority'
,
metavar
=
'hostname.queue'
)
(
args
,
unknwon_args
)
=
parser
.
parse_known_args
()
HOSTNAME
=
vars
(
args
)
.
pop
(
'hostname'
)
if
HOSTNAME
is
None
:
raise
Exception
(
'You must define hostname as -n <hostname> or '
'--hostname=<hostname>.
\n
'
'Hostname format must be hostname.queue.'
)
AMQP_URI
=
getenv
(
'AMQP_URI'
)
DNS_DB_DIR
=
getenv
(
'DNS_DB_DIR'
,
'/var/lib/circle/dnsdriver'
)
...
...
@@ -15,7 +26,7 @@ celery.conf.update(
CELERY_RESULT_BACKEND
=
'amqp'
,
CELERY_TASK_RESULT_EXPIRES
=
300
,
CELERY_QUEUES
=
(
Queue
(
HOSTNAME
+
'.dns'
,
Exchange
(
Queue
(
HOSTNAME
,
Exchange
(
'dnsdriver'
,
type
=
'direct'
),
routing_key
=
'dnsdriver'
),
)
)
...
...
This diff is collapsed.
Click to expand it.
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