Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.


fix(compose): copy args on every request
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Aug 8, 2019
1 parent 5503dbe commit 6856cb0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gnes/composer/
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# limitations under the License.
import io

import copy

from .base import YamlComposer
from ..cli.parser import set_composer_parser
from ..helper import set_logger
Expand Down Expand Up @@ -54,12 +56,13 @@ def _regenerate():
if not data or 'yaml-config' not in data:
return '<h1>Bad POST request</h1> your POST request does not contain "yaml-config" field!', 406
args.yaml_path = io.StringIO(data['yaml-config'])
_args = copy.deepcopy(args)
_args.yaml_path = io.StringIO(data['yaml-config'])
if data.get('mermaid_direction', 'top-down').lower() == 'left-right':
args.mermaid_leftright = True
_args.mermaid_leftright = True
if 'docker-image' in data:
args.docker_img = data['docker-image']
return YamlComposer(args).build_all()['html']
_args.docker_img = data['docker-image']
return YamlComposer(_args).build_all()['html']
except Exception as e:
return '<h1>Bad YAML input</h1> please kindly check the format, indent and content of your YAML file!', 400
Expand Down

0 comments on commit 6856cb0

Please sign in to comment.