Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
16
Issue boards
Milestones
Wiki
Code
Merge requests
10
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
rabbitmq_agents
Commits
286b320d
Commit
286b320d
authored
5 years ago
by
Eesaan Atluri
Browse files
Options
Downloads
Patches
Plain Diff
Use rc_util class methods for logging and arg parsing in bright account create agent
parent
ced31774
No related branches found
No related tags found
6 merge requests
!147
Merge previous default branch feat-cod-rmq into main
,
!85
kill nginx process running under user from login node
,
!51
Fix acct create wait
,
!45
Revert 29 feat add user bright cm
,
!39
WIP:Feat cod rmq
,
!29
Feat add user bright cm
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
brightcm_account_create.py
+3
-14
3 additions, 14 deletions
brightcm_account_create.py
with
3 additions
and
14 deletions
brightcm_account_create.py
+
3
−
14
View file @
286b320d
...
@@ -3,6 +3,7 @@ import sys
...
@@ -3,6 +3,7 @@ import sys
import
json
import
json
import
logging
import
logging
import
argparse
import
argparse
import
rc_util
from
os
import
popen
from
os
import
popen
from
rc_rmq
import
RCRMQ
from
rc_rmq
import
RCRMQ
...
@@ -12,22 +13,10 @@ task = 'bright_account'
...
@@ -12,22 +13,10 @@ task = 'bright_account'
rc_rmq
=
RCRMQ
({
'
exchange
'
:
'
RegUsr
'
,
'
exchange_type
'
:
'
topic
'
})
rc_rmq
=
RCRMQ
({
'
exchange
'
:
'
RegUsr
'
,
'
exchange_type
'
:
'
topic
'
})
# Parse arguments
# Parse arguments
parser
=
argparse
.
ArgumentParser
()
args
=
rc_util
.
get_args
()
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
store_true
'
,
help
=
'
verbose output
'
)
parser
.
add_argument
(
'
-n
'
,
'
--dry-run
'
,
action
=
'
store_true
'
,
help
=
'
enable dry run mode
'
)
args
=
parser
.
parse_args
()
#Default Log level
log_lvl
=
logging
.
WARNING
if
args
.
verbose
:
log_lvl
=
logging
.
DEBUG
if
args
.
dry_run
:
log_lvl
=
logging
.
INFO
# Logger
# Logger
logging
.
basicConfig
(
format
=
'
%(asctime)s %(levelname)s [%(module)s] - %(message)s
'
,
level
=
log_lvl
)
logger
=
rc_util
.
get_logger
()
logger
=
logging
.
getLogger
(
__name__
)
# Define your callback function
# Define your callback function
def
bright_account_create
(
ch
,
method
,
properties
,
body
):
def
bright_account_create
(
ch
,
method
,
properties
,
body
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment