Skip to content

Commit dc875d4

Browse files
1.7.5
Changelog: * Overwrite templates on `templates_rewrite: true` instead of rewrite. (vstconsulting/polemarch#103) See merge request polemarch/ce!195
2 parents 7f67ec1 + b6c4be7 commit dc875d4

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

polemarch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"VST_ROOT_URLCONF": os.getenv("VST_ROOT_URLCONF", 'vstutils.urls'),
3232
}
3333

34-
__version__ = "1.7.4"
34+
__version__ = "1.7.5"
3535

3636
prepare_environment(**default_settings)

polemarch/main/repo/_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ def __create_template(self, template_name: Text, template_data: Dict) -> Templat
7979
:param template_data: Template data
8080
:return: created Template object
8181
'''
82-
self.message('Loading template[{}] into the project.'.format(template_name))
83-
return self.proj.template.create(name=template_name, **template_data)
82+
self.message(f'Loading template[{template_name}] into the project.')
83+
obj, created = self.proj.template.update_or_create(name=template_name, defaults=template_data)
84+
self.message(f'Template[{obj.name}] {"created" if created else "updated"} in the project.')
85+
return obj
8486

8587
def pm_handle_templates(self, feature: Text, data: Dict) -> NoReturn:
8688
'''

polemarch/main/tests/executions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ def test_project_git(self):
12861286
pm_yaml['sync_on_run'] = True
12871287
# templates
12881288
pm_yaml['templates'] = test_yaml_templates
1289-
pm_yaml['templates_rewrite'] = False
1289+
pm_yaml['templates_rewrite'] = True
12901290
# fast task widget
12911291
pm_yaml['view'] = test_yaml_view
12921292
# Prepare repo
239 Bytes
Binary file not shown.

requirements-test.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
vcrpy-unittest==0.1.6
2-
coverage<=4.5.4
3-
mock<=3.0.5
2+
coverage~=5.1
3+
mock~=3.0.5
44
fakeldap==0.6.1
5-
tblib==1.3.2
5+
tblib~=1.6.0

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
envlist = py3{6,7,8}-{coverage,install},flake,pylint,jshint
33
skipsdist = True
44
setenv = PIP_CONFIG_FILE=.pip.conf
5-
whitelist_externals =
5+
whitelist_externals =
66
rm
77
bash
88

@@ -12,7 +12,7 @@ passenv =
1212
DJANGO_LOG_LEVEL
1313
CC
1414
BUILD_COMPILE
15-
whitelist_externals =
15+
whitelist_externals =
1616
rm
1717
ls
1818
ln
@@ -44,7 +44,7 @@ deps =
4444
flake8
4545
-rrequirements.txt
4646
-rrequirements-git.txt
47-
commands =
47+
commands =
4848
flake8 --config=.pep8 polemarch
4949

5050
[testenv:jshint]
@@ -97,7 +97,7 @@ whitelist_externals =
9797
rm
9898
commands =
9999
rm -rf dist build
100-
tox -c tox_build.ini --workdir {toxworkdir}
100+
tox -c tox_build.ini -e py36-build,py37-wheel --workdir {toxworkdir}
101101

102102
[testenv:builddoc]
103103
basepython = python3.6
@@ -160,7 +160,7 @@ passenv = *
160160
whitelist_externals =
161161
/bin/sh
162162
commands =
163-
ansible-playbook -i localhost, --connection local k8s_env_destroy.yaml -vvvv
163+
ansible-playbook -i localhost, --connection local k8s_env_destroy.yaml -vvvv
164164
deps =
165165
ansible~=2.9.0
166166
openshift>=0.6

0 commit comments

Comments
 (0)