Skip to content

Commit

Permalink
1.5.2
Browse files Browse the repository at this point in the history
Changelog:
* Fix openapi tests.
* Fix bug with several enum fields in .polemarch.yaml form.

See merge request polemarch/ce!174
  • Loading branch information
onegreyonewhite committed Dec 10, 2019
2 parents 8b5400b + 88bfc33 commit c11b885
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 2,346 deletions.
26 changes: 13 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ py37-coverage:
<<: *branch_tests
variables:
TOX_ENVS: "$CI_BUILD_NAME"
allow_failure: true

py36-install:
<<: *branch_tests
Expand Down Expand Up @@ -184,23 +183,24 @@ release_pypi:
TOX_ARGS: ""
script:
- make test ENVS=build
- make twine
allow_failure: true
artifacts:
name: "release-rpm-${CI_BUILD_REF_NAME}.${CI_BUILD_ID}"
name: "release-packages-${CI_BUILD_REF_NAME}.${CI_BUILD_ID}"
paths:
- dist/

publish_pypi:
stage: publish
image: onegreyonewhite/tox:tox
only:
refs:
- tags
variables:
- $PYPI_UPLOAD_PASSWORD
- $PYPI_UPLOAD_NAME
script:
- make twine
#publish_pypi:
# stage: publish
# image: onegreyonewhite/tox:tox
# only:
# refs:
# - tags
# variables:
# - $PYPI_UPLOAD_PASSWORD
# - $PYPI_UPLOAD_NAME
# script:
# - make twine


publish_release:
Expand Down
80 changes: 24 additions & 56 deletions doc/api_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ info:
url: https://gitlab.com/vstconsulting/polemarch.git
Request:
- name: Question
url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Ask&issue%5Btitle%5D=Ask%20about%20version%201.4.4
url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Ask&issue%5Btitle%5D=Ask%20about%20version%201.5.2
- name: Bug report
url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Bug&issue%5Btitle%5D=Bug%20in%20version%201.4.4
url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Bug&issue%5Btitle%5D=Bug%20in%20version%201.5.2
- name: Feature request
url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Feature%20request&issue%5Btitle%5D=
x-menu:
Expand Down Expand Up @@ -54,11 +54,11 @@ info:
span_class: fa fa-plug
url: /hook
x-versions:
application: 1.4.4
library: 1.4.4
vstutils: 2.6.6
django: 2.2.4
ansible: 2.8.4
application: 1.5.2
library: 1.5.2
vstutils: 2.11.2
django: 2.2.7
ansible: 2.8.7
version: v2
host: localhost:8080
schemes:
Expand Down Expand Up @@ -8060,6 +8060,11 @@ paths:
description: Full path to module.
required: false
type: string
- name: name
in: query
description: Name of module.
required: false
type: string
- name: path__not
in: query
description: Full path to module.
Expand Down Expand Up @@ -8763,6 +8768,11 @@ paths:
description: Playbook filename.
required: false
type: string
- name: pb_filter
in: query
description: Playbook filename - filter for prefetch.
required: false
type: string
- name: id__not
in: query
description: A unique integer value (or comma separated list) identifying
Expand Down Expand Up @@ -11426,9 +11436,8 @@ definitions:
default: false
become_method:
title: Become method
description: 'privilege escalation method to use (default=sudo), valid choices:
[ sudo | su | pbrun | pfexec | doas | dzdo | ksu | runas | pmrun | enable
| machinectl ]'
description: privilege escalation method to use (default=%default), use `ansible-doc
-t become -l` to list valid choices.
type: string
become_user:
title: Become user
Expand Down Expand Up @@ -11486,8 +11495,7 @@ definitions:
default: false
module_path:
title: Module path
description: prepend colon-separated path(s) to module library (default=[u'/home/grey/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules'])
description: prepend colon-separated path(s) to module library (default=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules)
type: string
one_line:
title: One line
Expand All @@ -11496,7 +11504,7 @@ definitions:
default: false
playbook_dir:
title: Playbook dir
description: Since this tool does not use playbooks, use this as a subsitute
description: Since this tool does not use playbooks, use this as a substitute
playbook directory.This sets the relative path for many features including
roles/ group_vars/ etc.
type: string
Expand Down Expand Up @@ -11525,25 +11533,6 @@ definitions:
title: Ssh extra args
description: specify extra arguments to pass to ssh only (e.g. -R)
type: string
su:
title: Su
description: run operations with su (deprecated, use become)
type: boolean
default: false
su_user:
title: Su user
description: run operations with su as this user (default=None) (deprecated,
use become)
type: string
sudo:
title: Sudo
description: run operations with sudo (nopasswd) (deprecated, use become)
type: boolean
default: false
sudo_user:
title: Sudo user
description: desired sudo user (default=root) (deprecated, use become)
type: string
syntax_check:
title: Syntax check
description: perform a syntax check on the playbook, but do not execute it
Expand Down Expand Up @@ -11620,9 +11609,8 @@ definitions:
default: false
become_method:
title: Become method
description: 'privilege escalation method to use (default=sudo), valid choices:
[ sudo | su | pbrun | pfexec | doas | dzdo | ksu | runas | pmrun | enable
| machinectl ]'
description: privilege escalation method to use (default=%default), use `ansible-doc
-t become -l` to list valid choices.
type: string
become_user:
title: Become user
Expand Down Expand Up @@ -11700,8 +11688,7 @@ definitions:
default: false
module_path:
title: Module path
description: prepend colon-separated path(s) to module library (default=[u'/home/grey/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules'])
description: prepend colon-separated path(s) to module library (default=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules)
type: string
private_key:
title: Private key
Expand Down Expand Up @@ -11737,25 +11724,6 @@ definitions:
description: 'one-step-at-a-time: confirm each task before running'
type: boolean
default: false
su:
title: Su
description: run operations with su (deprecated, use become)
type: boolean
default: false
su_user:
title: Su user
description: run operations with su as this user (default=None) (deprecated,
use become)
type: string
sudo:
title: Sudo
description: run operations with sudo (nopasswd) (deprecated, use become)
type: boolean
default: false
sudo_user:
title: Sudo user
description: desired sudo user (default=root) (deprecated, use become)
type: string
syntax_check:
title: Syntax check
description: perform a syntax check on the playbook, but do not execute it
Expand Down
2 changes: 1 addition & 1 deletion polemarch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"VST_ROOT_URLCONF": os.getenv("VST_ROOT_URLCONF", 'vstutils.urls'),
}

__version__ = "1.5.1"
__version__ = "1.5.2"

prepare_environment(**default_settings)
3 changes: 2 additions & 1 deletion polemarch/main/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from .vars import Variable
from .hosts import Host, Group, Inventory
from .projects import Project, Task, Module, ProjectTemplate, list_to_choices
from .users import BaseUser, UserGroup, ACLPermission, UserSettings
from .users import get_user_model, UserGroup, ACLPermission, UserSettings
from .tasks import PeriodicTask, History, HistoryLines, Template
from .hooks import Hook
from ..validators import RegexValidator, validate_hostname
Expand All @@ -26,6 +26,7 @@


logger = logging.getLogger('polemarch')
BaseUser = get_user_model()


#####################################
Expand Down
4 changes: 2 additions & 2 deletions polemarch/main/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from typing import Callable, Any
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User as BaseUser
from django.contrib.auth import get_user_model
from django.utils.module_loading import import_string
from vstutils.utils import classproperty
from vstutils.models import BQuerySet as _BQSet, BaseModel as _BM, Manager as _BManager


def first_staff_user() -> int:
return BaseUser.objects.filter(is_staff=True).first().id
return get_user_model().objects.filter(is_staff=True).first().id


class BQuerySet(_BQSet):
Expand Down
3 changes: 2 additions & 1 deletion polemarch/main/models/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from django.db import transaction
from django.db.models import Q
from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.db.models import functions as dbfunc, Count
from django.utils.timezone import now
from django.test import Client
Expand All @@ -30,6 +30,7 @@

logger = logging.getLogger("polemarch")
InvOrString = TypeVar('InvOrString', str, int, Inventory, None)
User = get_user_model()


# Block of real models
Expand Down
3 changes: 1 addition & 2 deletions polemarch/main/models/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import json

from django.contrib.auth.models import Group as BaseGroup
from django.contrib.auth.models import User as BaseUser
from django.contrib.auth import get_user_model
from .base import models, BModel, ACLModel, BQuerySet

Expand Down Expand Up @@ -50,7 +49,7 @@ class UserGroup(BaseGroup, ACLModel):

class UserSettings(BModel):
settings = models.TextField(default="{}")
user = models.OneToOneField(BaseUser, on_delete=models.CASCADE,
user = models.OneToOneField(get_user_model(), on_delete=models.CASCADE,
related_query_name="settings",
related_name="settings")

Expand Down
1 change: 1 addition & 0 deletions polemarch/main/models/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class Meta:
'ansible_ssh_pass',
'ansible_ssh_private_key_file',
'ansible_become_pass',
'ansible_become_password',
'ansible_password'
]

Expand Down
7 changes: 1 addition & 6 deletions polemarch/main/tests/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
from django.test import Client
from django.contrib.auth.hashers import make_password
from django.utils.timezone import now

try:
from mock import patch
except ImportError: # nocv
from unittest.mock import patch

from unittest.mock import patch
from vstutils.utils import redirect_stdany
from ._base import BaseTestCase, json
from .hosts import InventoriesTestCase, InvBaseTestCase # noqa: F401
Expand Down
Loading

0 comments on commit c11b885

Please sign in to comment.