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
5a7ecd47
authored
Nov 05, 2018
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnscelery: fix hostname handling
parent
db009ffc
Hide 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 @
5a7ecd47
from
os
import
getenv
,
path
from
os
import
getenv
,
path
from
argparse
import
ArgumentParser
import
subprocess
import
subprocess
from
kombu
import
Queue
,
Exchange
from
kombu
import
Queue
,
Exchange
from
socket
import
gethostname
from
celery
import
Celery
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'
)
AMQP_URI
=
getenv
(
'AMQP_URI'
)
DNS_DB_DIR
=
getenv
(
'DNS_DB_DIR'
,
'/var/lib/circle/dnsdriver'
)
DNS_DB_DIR
=
getenv
(
'DNS_DB_DIR'
,
'/var/lib/circle/dnsdriver'
)
...
@@ -15,7 +26,7 @@ celery.conf.update(
...
@@ -15,7 +26,7 @@ celery.conf.update(
CELERY_RESULT_BACKEND
=
'amqp'
,
CELERY_RESULT_BACKEND
=
'amqp'
,
CELERY_TASK_RESULT_EXPIRES
=
300
,
CELERY_TASK_RESULT_EXPIRES
=
300
,
CELERY_QUEUES
=
(
CELERY_QUEUES
=
(
Queue
(
HOSTNAME
+
'.dns'
,
Exchange
(
Queue
(
HOSTNAME
,
Exchange
(
'dnsdriver'
,
type
=
'direct'
),
routing_key
=
'dnsdriver'
),
'dnsdriver'
,
type
=
'direct'
),
routing_key
=
'dnsdriver'
),
)
)
)
)
...
...
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