When the etcd key tracking realms is first created the action is create, not set.

This commit is contained in:
Jake Moshenko 2014-12-31 11:46:02 -05:00
parent cc70225043
commit a9839021af
2 changed files with 2 additions and 2 deletions

View file

@ -96,7 +96,7 @@ class EphemeralBuilderManager(BaseManager):
async(self._clean_up_old_builder(etcd_result.key, job_metadata))
def _handle_realm_change(self, etcd_result):
if etcd_result.action == EtcdAction.SET:
if etcd_result.action == EtcdAction.CREATE:
# We must listen on the realm created by ourselves or another worker
realm_spec = json.loads(etcd_result.value)
component = self.register_component(realm_spec['realm'], BuildComponent,

View file

@ -127,7 +127,7 @@ class TestEphemeral(unittest.TestCase):
self.assertEqual(self.register_component_callback.call_count, 0)
realm_created = Mock(spec=etcd.EtcdResult)
realm_created.action = EtcdAction.SET
realm_created.action = EtcdAction.CREATE
realm_created.key = os.path.join(ETCD_REALM_PREFIX, REALM_ID)
realm_created.value = json.dumps({
'realm': REALM_ID,