From f4084c800abf25c440a8663801b842d788409b0b Mon Sep 17 00:00:00 2001 From: xiaodong Date: Fri, 8 Jun 2018 16:15:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[Bugfix]=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E6=97=B6=E4=B8=8D=E5=A1=AB=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E4=B9=9F=E4=BC=9A=E8=A7=A6=E5=8F=91=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E5=88=99=E9=AA=8C=E8=AF=81,=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/views/user.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/users/views/user.py b/apps/users/views/user.py index 598726fc1..3adb1d156 100644 --- a/apps/users/views/user.py +++ b/apps/users/views/user.py @@ -109,12 +109,13 @@ class UserUpdateView(AdminUserRequiredMixin, SuccessMessageMixin, UpdateView): def form_valid(self, form): password = form.cleaned_data.get('password') - is_ok = check_password_rules(password) - if not is_ok: - form.add_error( - "password", _("* Your password does not meet the requirements") - ) - return self.form_invalid(form) + if password: + is_ok = check_password_rules(password) + if not is_ok: + form.add_error( + "password", _("* Your password does not meet the requirements") + ) + return self.form_invalid(form) return super().form_valid(form) From 1ef582e9ace0f13ce801bc04c76d34061760a84d Mon Sep 17 00:00:00 2001 From: xiaodong Date: Fri, 8 Jun 2018 16:39:16 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[Update]=E5=88=A0=E9=99=A4=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E9=85=8D=E7=BD=AE=E4=B8=AD=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84BROKER=5FURL=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_example.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config_example.py b/config_example.py index 45d4b00f3..0c8d87094 100644 --- a/config_example.py +++ b/config_example.py @@ -51,11 +51,6 @@ class Config: REDIS_HOST = '127.0.0.1' REDIS_PORT = 6379 REDIS_PASSWORD = '' - BROKER_URL = 'redis://%(password)s%(host)s:%(port)s/3' % { - 'password': REDIS_PASSWORD, - 'host': REDIS_HOST, - 'port': REDIS_PORT, - } def __init__(self): pass From 5579d3f0ded5329059c35a21cc06d22bfdafc239 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 8 Jun 2018 18:28:15 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[Update]=20=E4=BF=AE=E5=A4=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=BD=91=E5=85=B3=E8=BF=9E=E6=8E=A5known=5Fhost?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/utils.py | 1 - apps/ops/inventory.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/assets/utils.py b/apps/assets/utils.py index 367c5e5f7..cc4942ade 100644 --- a/apps/assets/utils.py +++ b/apps/assets/utils.py @@ -51,7 +51,6 @@ def test_gateway_connectability(gateway): client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) proxy = paramiko.SSHClient() - proxy.load_host_keys(os.path.expanduser('~/.ssh/known_hosts')) proxy.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: diff --git a/apps/ops/inventory.py b/apps/ops/inventory.py index 6230e8167..230af9dfe 100644 --- a/apps/ops/inventory.py +++ b/apps/ops/inventory.py @@ -86,6 +86,7 @@ class JMSInventory(BaseInventory): gateway = asset.domain.random_gateway() proxy_command_list = [ "ssh", "-p", str(gateway.port), + "-o", "StrictHostKeyChecking=no", "{}@{}".format(gateway.username, gateway.ip), "-W", "%h:%p", "-q", ] @@ -97,7 +98,7 @@ class JMSInventory(BaseInventory): if gateway.private_key: proxy_command_list.append("-i {}".format(gateway.private_key_file)) - proxy_command = "'-o ProxyCommand={}'".format( + proxy_command = "'-o ProxyCommand={}".format( " ".join(proxy_command_list) ) return {"ansible_ssh_common_args": proxy_command} From dbc471c1957191d304a66cf370c71513dca31cff Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 8 Jun 2018 18:40:31 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E5=B0=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/inventory.py | 2 +- apps/users/views/user.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/ops/inventory.py b/apps/ops/inventory.py index 230af9dfe..b7d3ef487 100644 --- a/apps/ops/inventory.py +++ b/apps/ops/inventory.py @@ -98,7 +98,7 @@ class JMSInventory(BaseInventory): if gateway.private_key: proxy_command_list.append("-i {}".format(gateway.private_key_file)) - proxy_command = "'-o ProxyCommand={}".format( + proxy_command = "'-o ProxyCommand={}'".format( " ".join(proxy_command_list) ) return {"ansible_ssh_common_args": proxy_command} diff --git a/apps/users/views/user.py b/apps/users/views/user.py index 3adb1d156..094d2ced2 100644 --- a/apps/users/views/user.py +++ b/apps/users/views/user.py @@ -109,14 +109,15 @@ class UserUpdateView(AdminUserRequiredMixin, SuccessMessageMixin, UpdateView): def form_valid(self, form): password = form.cleaned_data.get('password') - if password: - is_ok = check_password_rules(password) - if not is_ok: - form.add_error( - "password", _("* Your password does not meet the requirements") - ) - return self.form_invalid(form) + if not password: + return super().form_valid(form) + is_ok = check_password_rules(password) + if not is_ok: + form.add_error( + "password", _("* Your password does not meet the requirements") + ) + return self.form_invalid(form) return super().form_valid(form) From 73f9f546208cfba7146d81fed2e64d675d4c059d Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 11 Jun 2018 11:23:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/__init__.py | 2 +- apps/templates/_footer.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/__init__.py b/apps/__init__.py index c6491d9fa..7e96164aa 100644 --- a/apps/__init__.py +++ b/apps/__init__.py @@ -2,4 +2,4 @@ # -*- coding: utf-8 -*- # -__version__ = "1.3.1" +__version__ = "1.3.2" diff --git a/apps/templates/_footer.html b/apps/templates/_footer.html index 53f0bfa0f..c78f0da33 100644 --- a/apps/templates/_footer.html +++ b/apps/templates/_footer.html @@ -1,6 +1,6 @@