From c93c8de7fe0aa40694804799c87c93ca9b555ffa Mon Sep 17 00:00:00 2001 From: Kallen Ding Date: Tue, 7 Jun 2016 10:50:38 +0800 Subject: [PATCH 1/5] Replace os.makedirs to mkdir. (#251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决Tty Logs 日志跨天后目录权限不对的问题 --- jlog/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jlog/views.py b/jlog/views.py index d8a4268d1..5efd2bf9f 100644 --- a/jlog/views.py +++ b/jlog/views.py @@ -274,7 +274,7 @@ class TermLogRecorder(object): self.filename = filename filepath = os.path.join(path, 'tty', date, filename + '.zip') if not os.path.isdir(os.path.join(path, 'tty', date)): - os.makedirs(os.path.join(path, 'tty', date), mode=0777) + mkdir(os.path.join(path, 'tty', date), mode=777) while os.path.isfile(filepath): filename = str(uuid.uuid4()) filepath = os.path.join(path, 'tty', date, filename + '.zip') From f130a78f0a31184d0bc56f9b370b571bc34cc9cd Mon Sep 17 00:00:00 2001 From: lrqrun Date: Tue, 7 Jun 2016 10:54:11 +0800 Subject: [PATCH 3/5] users_selected keep new (#255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户组保存后数据显示的问题,在已选用户处显示选择的数据 --- templates/juser/group_add.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/juser/group_add.html b/templates/juser/group_add.html index 7257f5e58..df8d401c9 100644 --- a/templates/juser/group_add.html +++ b/templates/juser/group_add.html @@ -55,6 +55,9 @@
@@ -118,4 +121,4 @@ $(document).ready(function(){ -{% endblock %} \ No newline at end of file +{% endblock %} From b7be5d14e0e7bdd3acd8605d35ea591a9ee2875c Mon Sep 17 00:00:00 2001 From: lrqrun Date: Tue, 7 Jun 2016 10:55:28 +0800 Subject: [PATCH 4/5] User object is not the user, must update at the user (#254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改信息保存后数据不是最新的而是之前的数据,因为在object的惰性查询不会获取到最新的数据,因此需要在缓存的对象基础上修改save后commit到数据库。 --- juser/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/juser/views.py b/juser/views.py index 81e854d85..7335f30c8 100644 --- a/juser/views.py +++ b/juser/views.py @@ -419,7 +419,9 @@ def change_info(request): error = '不能为空' if not error: - User.objects.filter(id=user_id).update(name=name, email=email) + user.name = name + user.email = email + user.save() if len(password) > 0: user.set_password(password) user.save() From d6c4017a2ededd8b5bf37018140adb9814285c91 Mon Sep 17 00:00:00 2001 From: kikiyou <906852379@qq.com> Date: Mon, 6 Jun 2016 21:55:54 -0500 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BD=BF=E7=A4=BA=E4=BE=8B=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=AD=A3=E7=A1=AE=E8=BF=90=E8=A1=8C=20(#237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为了安全pattern=空,后示例代码无法使用,运行示例时加上pattern='*',使示例可以返回正确的结果 --- jperm/ansible_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jperm/ansible_api.py b/jperm/ansible_api.py index 20725908c..02d65907e 100644 --- a/jperm/ansible_api.py +++ b/jperm/ansible_api.py @@ -493,8 +493,8 @@ if __name__ == "__main__": # # "ansible_become_user": "root", # "ansible_become_pass": "yusky0902", }] - cmd = Command(resource) - print cmd.run('ls') + cmd.run('ls',pattern='*') + print cmd.results_raw # resource = [{"hostname": "192.168.10.148", "port": "22", "username": "root", "password": "xxx"}] # task = Tasks(resource)