Skip to content

Commit

Permalink
Merge pull request #952 from nacc/acl_fixes
Browse files Browse the repository at this point in the history
ACL fixes
  • Loading branch information
lmr committed Aug 10, 2015
2 parents e6d92ad + b3c5ab1 commit 7c7c6c8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cli/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def output(self, results):
self.print_list(results, key='hostname')
else:
super(host_list, self).output(results, keys=['hostname', 'status',
'locked', 'platform', 'labels'])
'locked', 'acls',
'platform', 'labels'])


class host_stat(host):
Expand Down
24 changes: 24 additions & 0 deletions cli/host_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def test_execute_list_all_no_labels(self):
u'locked': False,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [],
u'invalid': False,
u'synch_id': None,
Expand All @@ -128,6 +129,7 @@ def test_execute_list_all_no_labels(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -145,6 +147,7 @@ def test_execute_list_all_with_labels(self):
u'locked': False,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [u'label0', u'label1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -154,6 +157,7 @@ def test_execute_list_all_with_labels(self):
u'hostname': u'host1',
u'locked': True,
u'locked_by': 'user0',
u'acls': u'Everyone',
u'lock_time': u'2008-07-23 12:54:15',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
Expand All @@ -174,6 +178,7 @@ def test_execute_list_filter_one_host(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -196,6 +201,7 @@ def test_execute_list_filter_two_hosts(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -206,6 +212,7 @@ def test_execute_list_filter_two_hosts(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -229,6 +236,7 @@ def test_execute_list_filter_two_hosts_one_not_found(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': u'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand Down Expand Up @@ -262,6 +270,7 @@ def test_execute_list_filter_label(self):
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'labels': [u'label2', u'label3', u'plat1'],
u'acls': 'Everyone',
u'invalid': False,
u'synch_id': None,
u'platform': u'plat1',
Expand All @@ -271,6 +280,7 @@ def test_execute_list_filter_label(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -292,6 +302,7 @@ def test_execute_list_filter_multi_labels(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label2', u'label3', u'plat0'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -302,6 +313,7 @@ def test_execute_list_filter_multi_labels(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label2', u'plat2'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -324,6 +336,7 @@ def test_execute_list_filter_three_labels(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label2', u'label4',
u'plat1'],
u'invalid': False,
Expand All @@ -346,6 +359,7 @@ def test_execute_list_filter_wild_labels(self):
u'locked': 1,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label2', u'label4',
u'plat1'],
u'invalid': 0,
Expand Down Expand Up @@ -378,6 +392,7 @@ def test_execute_list_filter_label_and_hosts(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -388,6 +403,7 @@ def test_execute_list_filter_label_and_hosts(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand Down Expand Up @@ -419,6 +435,7 @@ def test_execute_list_filter_status(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -429,6 +446,7 @@ def test_execute_list_filter_status(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -450,6 +468,7 @@ def test_execute_list_filter_status_and_hosts(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -460,6 +479,7 @@ def test_execute_list_filter_status_and_hosts(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand Down Expand Up @@ -505,6 +525,7 @@ def test_execute_list_filter_locked(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -515,6 +536,7 @@ def test_execute_list_filter_locked(self):
u'locked': True,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -535,6 +557,7 @@ def test_execute_list_filter_unlocked(self):
u'locked': False,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label2', u'label3', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand All @@ -545,6 +568,7 @@ def test_execute_list_filter_unlocked(self):
u'locked': False,
u'locked_by': 'user0',
u'lock_time': u'2008-07-23 12:54:15',
u'acls': 'Everyone',
u'labels': [u'label3', u'label4', u'plat1'],
u'invalid': False,
u'synch_id': None,
Expand Down
1 change: 1 addition & 0 deletions cli/topic_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class __init__() before adding its own parser arguments.
'status': 'Status',
'locked': 'Locked',
'locked_by': 'Locked by',
'acls': 'ACLs',
'lock_time': 'Locked time',
'labels': 'Labels',
'description': 'Description',
Expand Down
2 changes: 0 additions & 2 deletions frontend/afe/reservations.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def create(hosts_to_reserve, username=None):
user_acl.users = [user]
user_acl.save()
for host in hosts:
# remove host from other acls
user_acl.hosts.clear()
host.aclgroup_set.add(user_acl)
# and add to reservation acl
user_acl.hosts.add(*hosts)
Expand Down
1 change: 1 addition & 0 deletions frontend/client/src/autotest/afe/HostTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class HostTable extends DynamicTable {
{HostDataSource.OTHER_LABELS, "Other labels"},
{"status", "Status"},
{"locked", "Locked"},
{HostDataSource.HOST_ACLS, "ACLs"},
};

public HostTable(DataSource dataSource) {
Expand Down

0 comments on commit 7c7c6c8

Please sign in to comment.