aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject incubator-aurora git commit: Added 'none' host maintenance grouping function.
Date Thu, 12 Mar 2015 23:48:57 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master f62e0f13f -> ee1a13afb


Added 'none' host maintenance grouping function.

Bugs closed: AURORA-1181

Reviewed at https://reviews.apache.org/r/31913/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/ee1a13af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/ee1a13af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/ee1a13af

Branch: refs/heads/master
Commit: ee1a13afb01d81d94056f795256be89d70c45276
Parents: f62e0f1
Author: David Robinson <drobinson@twitter.com>
Authored: Thu Mar 12 16:48:46 2015 -0700
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Thu Mar 12 16:48:46 2015 -0700

----------------------------------------------------------------------
 src/main/python/apache/aurora/client/base.py            |  5 +++++
 .../python/apache/aurora/admin/test_host_maintenance.py | 12 ++++++++++++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/ee1a13af/src/main/python/apache/aurora/client/base.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/base.py b/src/main/python/apache/aurora/client/base.py
index d550c8e..352d3f0 100644
--- a/src/main/python/apache/aurora/client/base.py
+++ b/src/main/python/apache/aurora/client/base.py
@@ -124,9 +124,14 @@ def group_by_host(hostname):
   return hostname
 
 
+def no_grouping(hostname):
+  return '_all_hosts_'
+
+
 DEFAULT_GROUPING = 'by_host'
 GROUPING_FUNCTIONS = {
     'by_host': group_by_host,
+    'none': no_grouping,
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/ee1a13af/src/test/python/apache/aurora/admin/test_host_maintenance.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/admin/test_host_maintenance.py b/src/test/python/apache/aurora/admin/test_host_maintenance.py
index bb58670..b7c13b7 100644
--- a/src/test/python/apache/aurora/admin/test_host_maintenance.py
+++ b/src/test/python/apache/aurora/admin/test_host_maintenance.py
@@ -263,6 +263,18 @@ def test_default_grouping():
   assert batches[2] == Hosts(set(['xyz321.example.com']))
 
 
+def test_none_grouping():
+  example_host_list = [
+    'xyz321.example.com',
+    'bar337.example.com',
+    'foo001.example.com',
+  ]
+
+  batches = list(HostMaintenance.iter_batches(example_host_list, 'none'))
+  assert batches[0] == Hosts(set(example_host_list))
+  assert len(batches) == 1
+
+
 @contextmanager
 def group_by_rack():
   add_grouping('by_rack', rack_grouping)


Mime
View raw message