diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-03-04 17:57:09 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-03-04 17:57:09 +0200 |
commit | 87c1fea3e7336adc6440f345bda04216abbdec1f (patch) | |
tree | 9adbdd3738660a23c212c7b492d9e2325010c65e /yarnhelper.py | |
parent | b101b66b0625fca398de1900852c66e154bf214b (diff) | |
download | git.liw.fi-ruleset-tests-87c1fea3e7336adc6440f345bda04216abbdec1f.tar.gz |
Add append_to_list
Diffstat (limited to 'yarnhelper.py')
-rw-r--r-- | yarnhelper.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/yarnhelper.py b/yarnhelper.py index 18467ed..6272102 100644 --- a/yarnhelper.py +++ b/yarnhelper.py @@ -70,6 +70,13 @@ class YarnHelper(object): with open(variables_filename, 'w') as f: yaml.safe_dump(variables, f) + def append_to_list(self, list_name, value): + if self._variables is None: + self._variables = self._load_variables() + items = self._variables.get(list_name, []) + items.append(value) + self.set_variable(list_name, items) + def construct_aliased_http_request( self, address, method, url, data=None, headers=None): |