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
beat
beat.cmdline
Commits
38cf79e3
Commit
38cf79e3
authored
Jul 28, 2020
by
Amir MOHAMMADI
Browse files
[config] don't save config on set
Fixes
beat.editor#277
parent
bcbaa84e
Pipeline
#41543
passed with stage
in 4 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/config.py
View file @
38cf79e3
...
...
@@ -114,7 +114,7 @@ class Configuration(object):
return
dict
((
k
,
self
.
__data
[
k
])
for
k
in
self
.
__data
if
self
.
is_database_key
(
k
))
def
set
(
self
,
key
,
value
,
local
=
False
):
def
set
(
self
,
key
,
value
):
"""Sets or resets a field in the configuration"""
if
not
self
.
_is_valid_key
(
key
):
...
...
@@ -126,8 +126,6 @@ class Configuration(object):
elif
key
in
DEFAULTS
:
self
.
__data
[
key
]
=
DEFAULTS
[
key
]
self
.
save
(
local
)
def
save
(
self
,
local
=
False
):
"""Saves contents to configuration file
...
...
@@ -256,6 +254,7 @@ def set(ctx, args, local):
try
:
for
idx
in
range
(
0
,
len
(
args
),
2
):
ctx
.
meta
[
"config"
].
set
(
args
[
idx
],
args
[
idx
+
1
],
local
)
ctx
.
meta
[
"config"
].
set
(
args
[
idx
],
args
[
idx
+
1
])
ctx
.
meta
[
"config"
].
save
(
local
)
except
Exception
:
raise
click
.
ClickException
(
"Failed to change the configuration."
)
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