aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject incubator-aurora git commit: Change "update list" subcommand to accept a hierarchy.
Date Fri, 20 Mar 2015 00:44:53 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 465086e59 -> 0214e708b


Change "update list" subcommand to accept a hierarchy.

Bugs closed: AURORA-1168

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


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

Branch: refs/heads/master
Commit: 0214e708b3add2b61864c7dae7b7a1109446d091
Parents: 465086e
Author: Bill Farner <wfarner@apache.org>
Authored: Thu Mar 19 17:44:34 2015 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Thu Mar 19 17:44:34 2015 -0700

----------------------------------------------------------------------
 .../python/apache/aurora/client/cli/update.py   | 148 +++++++++----
 .../apache/aurora/client/cli/test_supdate.py    | 208 +++++++++++--------
 2 files changed, 234 insertions(+), 122 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/0214e708/src/main/python/apache/aurora/client/cli/update.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/update.py b/src/main/python/apache/aurora/client/cli/update.py
index f025d46..2168e99 100644
--- a/src/main/python/apache/aurora/client/cli/update.py
+++ b/src/main/python/apache/aurora/client/cli/update.py
@@ -14,9 +14,11 @@
 
 from __future__ import print_function
 
+import datetime
 import json
 import textwrap
 import time
+from collections import namedtuple
 
 from apache.aurora.client.base import combine_messages
 from apache.aurora.client.cli import (
@@ -37,10 +39,8 @@ from apache.aurora.client.cli.options import (
     HEALTHCHECK_OPTION,
     INSTANCES_SPEC_ARGUMENT,
     JOBSPEC_ARGUMENT,
-    JOBSPEC_OPTION,
     JSON_READ_OPTION,
     JSON_WRITE_OPTION,
-    ROLE_OPTION,
     STRICT_OPTION
 )
 from apache.aurora.common.aurora_job_key import AuroraJobKey
@@ -131,9 +131,8 @@ class StartUpdate(Verb):
   @property
   def help(self):
     return textwrap.dedent("""\
-        Start a scheduler-driven rolling upgrade on a running job, using the update
-        configuration within the config file as a control for update velocity and failure
-        tolerance.
+        Start a rolling update of a running job, using the update configuration within the
config
+        file as a control for update velocity and failure tolerance.
 
         The updater only takes action on instances in a job that have changed, meaning
         that changing a single instance will only induce a restart on the changed task instance.
@@ -175,7 +174,7 @@ class PauseUpdate(Verb):
 
   @property
   def help(self):
-    return """Pause a scheduler-driven rolling update."""
+    return """Pause an update."""
 
   def execute(self, context):
     job_key = context.options.jobspec
@@ -194,7 +193,7 @@ class ResumeUpdate(Verb):
 
   @property
   def help(self):
-    return """Resume a paused scheduler-driven rolling update."""
+    return """Resume an update."""
 
   def execute(self, context):
     job_key = context.options.jobspec
@@ -213,7 +212,7 @@ class AbortUpdate(Verb):
 
   @property
   def help(self):
-    return """Abort an in-progress scheduler-driven rolling update."""
+    return """Abort an in-progress update."""
 
   def execute(self, context):
     job_key = context.options.jobspec
@@ -222,63 +221,140 @@ class AbortUpdate(Verb):
         context.options.message)
 
 
+UpdateFilter = namedtuple('UpdateFilter', ['cluster', 'role', 'env', 'job'])
+
+
 class ListUpdates(Verb):
+  @staticmethod
+  def update_filter(filter_str):
+    if filter_str is None or filter_str == '':
+      raise ValueError('Update filter must be non-empty')
+    parts = filter_str.split('/')
+    if len(parts) == 0 or len(parts) > 4:
+      raise ValueError('Update filter must be a path of the form CLUSTER/ROLE/ENV/JOB.')
+    # Pad with None.
+    parts = parts + ([None] * (4 - len(parts)))
+    return UpdateFilter(
+        cluster=parts[0],
+        role=parts[1],
+        env=parts[2],
+        job=parts[3])
+
   @property
   def name(self):
     return 'list'
 
+  STATUS_GROUPS = dict({
+      'active': ACTIVE_JOB_UPDATE_STATES,
+      'all': JobUpdateStatus._VALUES_TO_NAMES.keys(),
+      'blocked': [
+          JobUpdateStatus.ROLL_FORWARD_AWAITING_PULSE, JobUpdateStatus.ROLL_BACK_AWAITING_PULSE],
+      'failed': [JobUpdateStatus.ERROR, JobUpdateStatus.FAILED, JobUpdateStatus.ROLLED_BACK],
+      'inactive': list(set(JobUpdateStatus._VALUES_TO_NAMES.keys()) - ACTIVE_JOB_UPDATE_STATES),
+      'paused': [JobUpdateStatus.ROLL_FORWARD_PAUSED, JobUpdateStatus.ROLL_BACK_PAUSED],
+      'succeeded': JobUpdateStatus.ROLLED_FORWARD,
+  }.items() + JobUpdateStatus._NAMES_TO_VALUES.items())
+
   def get_options(self):
     return [
-      JOBSPEC_OPTION,
-      ROLE_OPTION,
+      CommandOption(
+          'filter',
+          type=self.update_filter,
+          metavar="CLUSTER[/ROLE[/ENV[/JOB]]]",
+          help=('A path-like specifier for the scope of updates to list.')),
+      CommandOption(
+          "--status",
+          choices=self.STATUS_GROUPS,
+          default=[],
+          action="append",
+          help="""Update state to filter by. This may be specified multiple times, in which
case
+updates matching any of the specified statuses will be included."""),
       CommandOption("--user", default=None, metavar="username",
           help="The name of the user who initiated the update"),
-      CommandOption("--status", choices=JobUpdateStatus._NAMES_TO_VALUES,
-          default=None,
-          action="append", help="Set of update statuses to search for"),
-      JSON_WRITE_OPTION,
-      CommandOption("cluster", metavar="clustername",
-          help="Cluster to search for matching updates")]
+      JSON_WRITE_OPTION
+    ]
 
   @property
   def help(self):
-    return textwrap.dedent("""\
-        List all scheduler-driven jobs updates, with summary info, about active updates
-        that match a query.
-        """)
+    return "List summaries of job updates."
+
+  COLUMNS = [
+    ('JOB', 47),
+    ('UPDATE ID', 36),
+    ('STATUS', 15),
+    ('CREATED BY', 11),
+    ('STARTED', 19),
+    ('LAST MODIFIED', 19)
+  ]
+  FORMAT_STR = ' '.join(["{%d:%d}" % (i, col[1]) for i, col in enumerate(COLUMNS)])
+  HEADER = FORMAT_STR.format(*[c[0] for c in COLUMNS])
 
   def execute(self, context):
-    cluster = context.options.cluster
+    update_filter = context.options.filter
+    cluster = update_filter.cluster
+    if (update_filter.role is not None
+        and update_filter.env is not None
+        and update_filter.job is not None):
+
+      job_key = AuroraJobKey(
+          cluster=cluster,
+          role=update_filter.role,
+          env=update_filter.env,
+          name=update_filter.job)
+    else:
+      job_key = None
+
     api = context.get_api(cluster)
+
+    filter_statuses = set()
+    for status in context.options.status:
+      group = self.STATUS_GROUPS[status]
+      if isinstance(group, list):
+        filter_statuses = filter_statuses.union(set(group))
+      else:
+        filter_statuses.add(group)
+
     response = api.query_job_updates(
-        role=context.options.role,
-        job_key=context.options.jobspec,
-        user=context.options.user,
-        update_statuses=context.options.status)
+        role=update_filter.role if job_key is None else None,
+        job_key=job_key,
+        update_statuses=filter_statuses if filter_statuses else None,
+        user=context.options.user)
     context.log_response_and_raise(response)
+
+    # The API does not offer a way to query by environment, so if that filter is requested,
we
+    # perform a more broad role-based query and filter here.
+    summaries = response.result.getJobUpdateSummariesResult.updateSummaries
+    if job_key is None and update_filter.env is not None:
+      summaries = [s for s in summaries if s.key.job.environment == update_filter.env]
+
+    def format_timestamp(stamp_millis):
+      return datetime.datetime.utcfromtimestamp(stamp_millis / 1000).isoformat()
+
     if context.options.write_json:
       result = []
-      for summary in response.result.getJobUpdateSummariesResult.updateSummaries:
+      for summary in summaries:
         job_entry = {
-            "jobkey": AuroraJobKey.from_thrift(cluster, summary.key.job).to_path(),
+            "job": AuroraJobKey.from_thrift(cluster, summary.key.job).to_path(),
             "id": summary.key.id,
             "user": summary.user,
-            "started": summary.state.createdTimestampMs,
-            "lastModified": summary.state.lastModifiedTimestampMs,
+            "started": format_timestamp(summary.state.createdTimestampMs),
+            "lastModified": format_timestamp(summary.state.lastModifiedTimestampMs),
             "status": JobUpdateStatus._VALUES_TO_NAMES[summary.state.status]
         }
         result.append(job_entry)
       context.print_out(json.dumps(result, indent=2, separators=[',', ': '], sort_keys=False))
     else:
-      for summary in response.result.getJobUpdateSummariesResult.updateSummaries:
-        created = summary.state.createdTimestampMs
-        lastMod = summary.state.lastModifiedTimestampMs
-        context.print_out("Job: %s, Id: %s, User: %s, Status: %s" % (
+      if summaries:
+        context.print_out(self.HEADER)
+      for summary in summaries:
+        context.print_out(self.FORMAT_STR.format(
             AuroraJobKey.from_thrift(cluster, summary.key.job).to_path(),
             summary.key.id,
+            JobUpdateStatus._VALUES_TO_NAMES[summary.state.status],
             summary.user,
-            JobUpdateStatus._VALUES_TO_NAMES[summary.state.status]))
-        context.print_out("Created: %s, Last Modified %s" % (created, lastMod), indent=2)
+            format_timestamp(summary.state.createdTimestampMs),
+            format_timestamp(summary.state.lastModifiedTimestampMs))
+        )
     return EXIT_OK
 
 
@@ -292,7 +368,7 @@ class UpdateStatus(Verb):
 
   @property
   def help(self):
-    return """Display detailed status information about a scheduler-driven in-progress update."""
+    return """Display detailed status information about an in-progress update."""
 
   def execute(self, context):
     key = UpdateController(

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/0214e708/src/test/python/apache/aurora/client/cli/test_supdate.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_supdate.py b/src/test/python/apache/aurora/client/cli/test_supdate.py
index cb66439..df072e9 100644
--- a/src/test/python/apache/aurora/client/cli/test_supdate.py
+++ b/src/test/python/apache/aurora/client/cli/test_supdate.py
@@ -13,7 +13,6 @@
 #
 import contextlib
 import json
-import textwrap
 
 import pytest
 from mock import call, create_autospec, Mock, patch
@@ -28,7 +27,7 @@ from apache.aurora.client.cli import (
 )
 from apache.aurora.client.cli.client import AuroraCommandLine
 from apache.aurora.client.cli.options import TaskInstanceKey
-from apache.aurora.client.cli.update import StartUpdate, UpdateStatus
+from apache.aurora.client.cli.update import ListUpdates, StartUpdate, UpdateFilter, UpdateStatus
 from apache.aurora.common.aurora_job_key import AuroraJobKey
 from apache.aurora.config import AuroraConfig
 
@@ -58,6 +57,25 @@ from gen.apache.aurora.api.ttypes import (
 UPDATE_KEY = JobUpdateKey(job=AuroraClientCommandTest.TEST_JOBKEY.to_thrift(), id="update_id")
 
 
+def get_status_query_response(count=1):
+  return Response(
+      responseCode=ResponseCode.OK,
+      result=Result(
+          getJobUpdateSummariesResult=GetJobUpdateSummariesResult(
+              updateSummaries=[
+                  JobUpdateSummary(
+                      key=UPDATE_KEY,
+                      user="me",
+                      state=JobUpdateState(
+                          status=JobUpdateStatus.ROLLED_FORWARD,
+                          createdTimestampMs=1411404927,
+                          lastModifiedTimestampMs=14114056030)) for i in range(count)
+              ]
+          )
+      )
+  )
+
+
 class TestStartUpdateCommand(AuroraClientCommandTest):
 
   def setUp(self):
@@ -115,6 +133,99 @@ class TestStartUpdateCommand(AuroraClientCommandTest):
     ]
 
 
+class TestListUpdatesCommand(AuroraClientCommandTest):
+
+  def setUp(self):
+    self._command = ListUpdates()
+    self._job_key = AuroraJobKey.from_thrift("cluster", UPDATE_KEY.job)
+    self._mock_options = mock_verb_options(self._command)
+    self._mock_options.filter = UpdateFilter(
+      cluster=self.TEST_CLUSTER, role=None, env=None, job=None)
+    self._fake_context = FakeAuroraCommandContext()
+    self._fake_context.set_options(self._mock_options)
+    self._mock_api = self._fake_context.get_api('UNUSED')
+
+  def test_list_updates_command(self):
+    self._mock_api.query_job_updates.return_value = get_status_query_response(count=3)
+    self._mock_options.user = 'me'
+
+    assert self._command.execute(self._fake_context) == EXIT_OK
+    assert self._mock_api.query_job_updates.mock_calls == [
+      call(role=None, user="me", job_key=None, update_statuses=None)
+    ]
+
+    # Ideally we would use a resource file for this, but i was unable to find a way to make
that
+    # work in both pants and pycharm.
+    assert self._fake_context.get_out_str() == "\
+JOB                                             UPDATE ID                            STATUS
       \
+  CREATED BY  STARTED             LAST MODIFIED      " + """
+west/bozo/test/hello                            update_id                            ROLLED_FORWARD\
+  me          1970-01-17T08:03:24 1970-06-13T08:34:16
+west/bozo/test/hello                            update_id                            ROLLED_FORWARD\
+  me          1970-01-17T08:03:24 1970-06-13T08:34:16
+west/bozo/test/hello                            update_id                            ROLLED_FORWARD\
+  me          1970-01-17T08:03:24 1970-06-13T08:34:16"""
+
+  def test_list_updates_by_status(self):
+    self._mock_options.status = ['paused', 'ROLLING_FORWARD']
+    self._mock_api.query_job_updates.return_value = get_status_query_response(count=3)
+    assert self._command.execute(self._fake_context) == EXIT_OK
+    assert self._mock_api.query_job_updates.mock_calls == [
+      call(
+          role=None,
+          user=None,
+          job_key=None,
+          update_statuses=set([
+              JobUpdateStatus.ROLL_FORWARD_PAUSED,
+              JobUpdateStatus.ROLL_BACK_PAUSED,
+              JobUpdateStatus.ROLLING_FORWARD
+          ]))
+    ]
+
+  def test_list_updates_by_env(self):
+    self._mock_options.filter = UpdateFilter(
+      cluster=self.TEST_CLUSTER, role='role', env='noenv', job=None)
+    self._mock_api.query_job_updates.return_value = get_status_query_response(count=3)
+    assert self._command.execute(self._fake_context) == EXIT_OK
+    assert self._mock_api.query_job_updates.mock_calls == [
+      call(role="role", user=None, job_key=None, update_statuses=None)
+    ]
+    # None of the returned values matched the env filter, so there is no output.
+    assert self._fake_context.get_out_str() == ''
+
+  def test_list_updates_command_json(self):
+    self._mock_options.user = 'me'
+    self._mock_options.write_json = True
+    self._mock_api.query_job_updates.return_value = get_status_query_response(count=3)
+    assert self._command.execute(self._fake_context) == EXIT_OK
+    assert json.loads(self._fake_context.get_out_str()) == [
+        {
+            "status": "ROLLED_FORWARD",
+            "started": "1970-01-17T08:03:24",
+            "lastModified": "1970-06-13T08:34:16",
+            "user": "me",
+            "job": "west/bozo/test/hello",
+            "id": "update_id"
+        },
+        {
+            "status": "ROLLED_FORWARD",
+            "started": "1970-01-17T08:03:24",
+            "lastModified": "1970-06-13T08:34:16",
+            "user": "me",
+            "job": "west/bozo/test/hello",
+            "id": "update_id"
+        },
+        {
+            "status": "ROLLED_FORWARD",
+            "started": "1970-01-17T08:03:24",
+            "lastModified": "1970-06-13T08:34:16",
+            "user": "me",
+            "job": "west/bozo/test/hello",
+            "id": "update_id"
+        }
+    ]
+
+
 class TestUpdateStatusCommand(AuroraClientCommandTest):
 
   def setUp(self):
@@ -208,7 +319,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
-      mock_api.query_job_updates.return_value = self.get_status_query_response()
+      mock_api.query_job_updates.return_value = get_status_query_response()
       mock_api.pause_job_update.return_value = self.create_simple_success_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -229,7 +340,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
-      mock_api.query_job_updates.return_value = self.get_status_query_response()
+      mock_api.query_job_updates.return_value = get_status_query_response()
       mock_api.abort_job_update.return_value = self.create_simple_success_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -250,7 +361,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
-      mock_api.query_job_updates.return_value = self.get_status_query_response()
+      mock_api.query_job_updates.return_value = get_status_query_response()
       mock_api.resume_job_update.return_value = self.create_simple_success_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -284,7 +395,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
-      mock_api.query_job_updates.return_value = self.get_status_query_response()
+      mock_api.query_job_updates.return_value = get_status_query_response()
       mock_api.resume_job_update.return_value = self.create_error_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -305,7 +416,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
-      mock_api.query_job_updates.return_value = self.get_status_query_response()
+      mock_api.query_job_updates.return_value = get_status_query_response()
       mock_api.abort_job_update.return_value = self.create_error_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -328,7 +439,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
 
       # Mimic the API returning two active updates for one job, which should be impossible.
-      mock_api.query_job_updates.return_value = self.get_status_query_response(count=2)
+      mock_api.query_job_updates.return_value = get_status_query_response(count=2)
       mock_api.abort_job_update.return_value = self.create_error_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -350,7 +461,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
         patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
       mock_api = mock_context.get_api(self.TEST_CLUSTER)
-      mock_api.query_job_updates.return_value = self.get_status_query_response()
+      mock_api.query_job_updates.return_value = get_status_query_response()
       mock_api.pause_job_update.return_value = self.create_error_response()
       with temporary_file() as fp:
         fp.write(self.get_valid_config())
@@ -365,81 +476,6 @@ class TestUpdateCommand(AuroraClientCommandTest):
       assert mock_context.get_out() == []
       assert mock_context.get_err() == ["Failed to pause update due to error:", "\tWhoops"]
 
-  def get_status_query_response(self, count=1):
-    return Response(
-        responseCode=ResponseCode.OK,
-        result=Result(
-            getJobUpdateSummariesResult=GetJobUpdateSummariesResult(
-                updateSummaries=[
-                    JobUpdateSummary(
-                        key=UPDATE_KEY,
-                        user="me",
-                        state=JobUpdateState(
-                            status=JobUpdateStatus.ROLLED_FORWARD,
-                            createdTimestampMs=1411404927,
-                            lastModifiedTimestampMs=14114056030)) for i in range(count)
-                ]
-            )
-        )
-    )
-
-  def test_list_updates_command(self):
-    mock_context = FakeAuroraCommandContext()
-    mock_context.get_api('west').query_job_updates.return_value = (
-        self.get_status_query_response(count=3))
-    with contextlib.nested(
-        patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
-        patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
-      cmd = AuroraCommandLine()
-      result = cmd.execute(["update", "list", self.TEST_CLUSTER, "--user=me"])
-      assert result == EXIT_OK
-      assert mock_context.get_out_str() == textwrap.dedent("""\
-          Job: west/bozo/test/hello, Id: update_id, User: me, Status: ROLLED_FORWARD
-            Created: 1411404927, Last Modified 14114056030
-          Job: west/bozo/test/hello, Id: update_id, User: me, Status: ROLLED_FORWARD
-            Created: 1411404927, Last Modified 14114056030
-          Job: west/bozo/test/hello, Id: update_id, User: me, Status: ROLLED_FORWARD
-            Created: 1411404927, Last Modified 14114056030""")
-
-  def test_list_updates_command_json(self):
-    mock_context = FakeAuroraCommandContext()
-    mock_context.get_api('west').query_job_updates.return_value = (
-        self.get_status_query_response(count=3))
-    with contextlib.nested(
-        patch('apache.aurora.client.cli.update.Update.create_context', return_value=mock_context),
-        patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):
-      cmd = AuroraCommandLine()
-      result = cmd.execute(["update", "list", self.TEST_CLUSTER, "--user=me", '--write-json'])
-      assert result == EXIT_OK
-      # TODO(wfarner): We really should not be performing string equality matching on JSON
data,
-      # as it is sensitive to field ordering.
-      assert json.loads(mock_context.get_out_str()) == [
-          {
-              "status": "ROLLED_FORWARD",
-              "started": 1411404927,
-              "lastModified": 14114056030,
-              "user": "me",
-              "jobkey": "west/bozo/test/hello",
-              "id": "update_id"
-          },
-          {
-              "status": "ROLLED_FORWARD",
-              "started": 1411404927,
-              "lastModified": 14114056030,
-              "user": "me",
-              "jobkey": "west/bozo/test/hello",
-              "id": "update_id"
-          },
-          {
-              "status": "ROLLED_FORWARD",
-              "started": 1411404927,
-              "lastModified": 14114056030,
-              "user": "me",
-              "jobkey": "west/bozo/test/hello",
-              "id": "update_id"
-          }
-      ]
-
   def get_update_details_response(self):
     query_response = Response()
     query_response.responseCode = ResponseCode.OK
@@ -487,7 +523,7 @@ class TestUpdateCommand(AuroraClientCommandTest):
   def test_update_status(self):
     mock_context = FakeAuroraCommandContext()
     api = mock_context.get_api(self.TEST_CLUSTER)
-    api.query_job_updates.return_value = self.get_status_query_response(count=1)
+    api.query_job_updates.return_value = get_status_query_response(count=1)
     api.get_job_update_details.return_value = self.get_update_details_response()
 
     with contextlib.nested(
@@ -518,7 +554,7 @@ Instance events:
   def test_update_status_json(self):
     mock_context = FakeAuroraCommandContext()
     api = mock_context.get_api(self.TEST_CLUSTER)
-    update_status_response = self.get_status_query_response(count=1)
+    update_status_response = get_status_query_response(count=1)
     api.query_job_updates.return_value = update_status_response
     api.get_job_update_details.return_value = self.get_update_details_response()
 


Mime
View raw message