Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
caosdb-pylib
Commits
834bbf96
Unverified
Commit
834bbf96
authored
6 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
BUG: commandline args messed up the configuration.
parent
b8b9e9b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/utils/caosdb_admin.py
+2
-34
2 additions, 34 deletions
src/caosdb/utils/caosdb_admin.py
with
2 additions
and
34 deletions
src/caosdb/utils/caosdb_admin.py
+
2
−
34
View file @
834bbf96
...
...
@@ -230,7 +230,7 @@ def main(argv=None):
program_build_date
=
str
(
__updated__
)
program_version_message
=
'
%%(prog)s %s (%s)
'
%
(
program_version
,
program_build_date
)
program_shortdesc
=
__import__
(
'
__main__
'
).
__doc__
.
split
(
"
\n
"
)[
1
]
program_shortdesc
=
__import__
(
'
__main__
'
).
__doc__
program_license
=
'''
%s
Created by timm fitschen on %s.
...
...
@@ -245,31 +245,8 @@ USAGE
# Setup argument parser
parser
=
ArgumentParser
(
description
=
program_license
,
formatter_class
=
RawDescriptionHelpFormatter
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
dest
=
"
verbose
"
,
action
=
"
count
"
,
help
=
"
Set verbosity level [default: %(default)s]
"
,
default
=
0
)
parser
.
add_argument
(
'
-V
'
,
'
--version
'
,
action
=
'
version
'
,
version
=
program_version_message
)
parser
.
add_argument
(
'
-t
'
,
'
--timeout
'
,
dest
=
"
con_timeout
"
,
help
=
"
Timeout in seconds for the database requests. [default: %(default)s]
"
,
metavar
=
"
TIMEOUT
"
,
default
=
200
)
parser
.
add_argument
(
'
-u
'
,
'
--user
'
,
dest
=
"
con_user
"
,
help
=
"
The user name you want to login with and do the administration stuff with. It will be prompted for a password.
"
,
metavar
=
"
USER
"
)
parser
.
add_argument
(
'
-c
'
,
'
--connection_uri
'
,
dest
=
"
con_uri
"
,
help
=
"
The URI of the caosdb server.
"
,
metavar
=
"
URI
"
)
subparsers
=
parser
.
add_subparsers
(
title
=
"
commands
"
,
metavar
=
"
COMMAND
"
,
...
...
@@ -558,17 +535,8 @@ USAGE
# Process arguments
args
=
parser
.
parse_args
()
VERBOSITY
=
args
.
verbose
timeout
=
int
(
args
.
con_timeout
)
password
=
None
if
args
.
con_user
is
not
None
:
password
=
getpass
.
getpass
(
prompt
=
"
login password:
"
)
db
.
configure_connection
(
url
=
args
.
con_uri
,
username
=
args
.
con_user
,
password
=
password
,
timeout
=
timeout
)
db
.
get_connection
().
_debug
=
lambda
:
VERBOSITY
db
.
Container
.
_debug
=
staticmethod
(
lambda
:
VERBOSITY
)
db
.
configure_connection
().
_login
()
return
args
.
call
(
args
)
...
...
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