Skip to content

Commit

Permalink
Update min vstutils version
Browse files Browse the repository at this point in the history
  • Loading branch information
onegreyonewhite committed Dec 10, 2019
1 parent 1bc9ed1 commit 88bfc33
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 66 deletions.
100 changes: 50 additions & 50 deletions doc/api_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,52 @@ info:
has_docs: true
docs_url: /docs/
x-links:
Request:
- url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Ask&issue%5Btitle%5D=Ask%20about%20version%201.5.1
name: Question
- url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Bug&issue%5Btitle%5D=Bug%20in%20version%201.5.1
name: Bug report
- url: https://gitlab.com/vstconsulting/polemarch/issues/new?issuable_template%5D=Feature%20request&issue%5Btitle%5D=
name: Feature request
Documentation:
url: http://polemarch.readthedocs.io/
name: Official documentation
url: http://polemarch.readthedocs.io/
Repository:
url: https://gitlab.com/vstconsulting/polemarch.git
name: Official repository
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.5.2
- name: Bug report
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:
- name: Projects
url: /project
span_class: fa fa-fort-awesome
url: /project
- name: Community
url: /community_template
span_class: fa fa-cloud
url: /community_template
- name: Inventories
url: /inventory
span_class: fa fa-folder
sublinks:
- name: Groups
url: /group
span_class: fa fa-tasks
url: /group
- name: Hosts
url: /host
span_class: fa fa-codepen
url: /host
url: /inventory
- name: History
url: /history
span_class: fa fa-calendar
url: /history
- name: System
span_class: fa fa-cog
sublinks:
- name: Users
url: /user
span_class: fa fa-user
url: /user
- name: Hooks
url: /hook
span_class: fa fa-plug
url: /hook
x-versions:
application: 1.5.1
library: 1.5.1
vstutils: 2.11.1
application: 1.5.2
library: 1.5.2
vstutils: 2.11.2
django: 2.2.7
ansible: 2.8.7
version: v2
Expand Down Expand Up @@ -10953,14 +10953,14 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: key
choices: {}
field: key
types:
ansible_ssh_pass: password
ansible_ssh_private_key_file: secretfile
ansible_become: boolean
ansible_port: integer
ansible_become_pass: password
ansible_port: integer
ansible_ssh_pass: password
ansible_ssh_private_key_file: secretfile
Host:
type: object
properties:
Expand Down Expand Up @@ -11325,38 +11325,38 @@ definitions:
format: dynamic
default: NONE
additionalProperties:
field: type
choices:
GIT:
- NONE
- KEY
- PASSWORD
field: type
types:
MANUAL: hidden
GIT: string
MANUAL: hidden
TAR: hidden
auth_data:
title: Repo auth data
type: string
format: dynamic
default: ''
additionalProperties:
field: repo_auth
choices: {}
field: repo_auth
types:
KEY: secretfile
PASSWORD: password
NONE: hidden
PASSWORD: password
branch:
title: Branch for GIT(branch/tag/SHA) or TAR(subdir)
type: string
format: dynamic
additionalProperties:
field: type
choices: {}
field: type
types:
MANUAL: hidden
GIT: string
MANUAL: hidden
TAR: string
x-nullable: true
OneProject:
Expand Down Expand Up @@ -11885,22 +11885,22 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: kind
choices: {}
field: kind
types:
PLAYBOOK: fk_autocomplete
MODULE: fk_autocomplete
PLAYBOOK: fk_autocomplete
TEMPLATE: hidden
inventory:
title: Inventory
type: string
format: dynamic
additionalProperties:
field: kind
choices: {}
field: kind
types:
PLAYBOOK: fk_autocomplete
MODULE: fk_autocomplete
PLAYBOOK: fk_autocomplete
TEMPLATE: hidden
save_result:
title: Save result
Expand All @@ -11914,11 +11914,11 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: kind
choices: {}
field: kind
types:
PLAYBOOK: hidden
MODULE: hidden
PLAYBOOK: hidden
TEMPLATE: autocomplete
enabled:
title: Enabled
Expand All @@ -11935,8 +11935,8 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: type
choices: {}
field: type
types:
CRONTAB: crontab
INTERVAL: integer
Expand Down Expand Up @@ -11967,22 +11967,22 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: kind
choices: {}
field: kind
types:
PLAYBOOK: fk_autocomplete
MODULE: fk_autocomplete
PLAYBOOK: fk_autocomplete
TEMPLATE: hidden
inventory:
title: Inventory
type: string
format: dynamic
additionalProperties:
field: kind
choices: {}
field: kind
types:
PLAYBOOK: fk_autocomplete
MODULE: fk_autocomplete
PLAYBOOK: fk_autocomplete
TEMPLATE: hidden
save_result:
title: Save result
Expand All @@ -11996,11 +11996,11 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: kind
choices: {}
field: kind
types:
PLAYBOOK: hidden
MODULE: hidden
PLAYBOOK: hidden
TEMPLATE: autocomplete
enabled:
title: Enabled
Expand All @@ -12017,8 +12017,8 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: type
choices: {}
field: type
types:
CRONTAB: crontab
INTERVAL: integer
Expand Down Expand Up @@ -12182,20 +12182,20 @@ definitions:
type: string
format: dynamic
additionalProperties:
field: key
choices:
repo_sync_on_run:
- true
- false
repo_type:
- MANUAL
- GIT
- TAR
repo_sync_on_run:
- true
- false
field: key
types:
repo_password: password
ci_template: fk
repo_key: secretfile
repo_password: password
repo_sync_on_run_timeout: uptime
ci_template: fk
Team:
required:
- name
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
4 changes: 3 additions & 1 deletion polemarch/main/tests/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from ._base import BaseTestCase


openapi_schema_yaml = Path(__file__).parent.parent.parent.parent / 'doc' / 'api_schema.yaml'
openapi_schema_yaml = Path.cwd().parent.parent / 'doc' / 'api_schema.yaml'
if not openapi_schema_yaml.exists():
openapi_schema_yaml = Path(__file__).parent.parent.parent.parent / 'doc' / 'api_schema.yaml'


class OApiTestCase(BaseTestCase):
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,35,36,37}-{django111}-{coverage,install},flake,pylint
envlist = py{35,36,37}-{coverage,install},flake,pylint
skipsdist = True
setenv = PIP_CONFIG_FILE=.pip.conf
whitelist_externals =
Expand Down Expand Up @@ -34,7 +34,6 @@ commands =
deps =
coverage: -rrequirements.txt
install: cython>=0.29.2
py27-install: multiprocessing
-rrequirements-doc.txt
-rrequirements-git.txt
-rrequirements-test.txt
Expand Down

0 comments on commit 88bfc33

Please sign in to comment.