From dcd1ea23d8320e9b8e93d70ab65de1be1c540465 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Wed, 30 Sep 2015 10:08:26 +0200 Subject: [PATCH] Everything validates now --- resources/transport_solard/meta.yaml | 6 +++--- resources/transport_ssh/meta.yaml | 7 ++++--- resources/transports/meta.yaml | 2 +- solar/solar/core/signals.py | 8 +++++++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/resources/transport_solard/meta.yaml b/resources/transport_solard/meta.yaml index ac8b7aab..41532c5d 100644 --- a/resources/transport_solard/meta.yaml +++ b/resources/transport_solard/meta.yaml @@ -17,10 +17,10 @@ input: schema: str! value: solard location_id: - schema: str! + schema: str value: reverse: True is_own: False transports_id: - schema: str! - value: False + schema: str + is_emit: False diff --git a/resources/transport_ssh/meta.yaml b/resources/transport_ssh/meta.yaml index 97d27fbd..4b607ec6 100644 --- a/resources/transport_ssh/meta.yaml +++ b/resources/transport_ssh/meta.yaml @@ -13,10 +13,11 @@ input: schema: str! value: ssh location_id: - schema: str! + schema: str value: reverse: True is_own: False transports_id: - schema: str! - value: False + schema: str + value: + is_emit: False diff --git a/resources/transports/meta.yaml b/resources/transports/meta.yaml index b5c70947..d73bb018 100644 --- a/resources/transports/meta.yaml +++ b/resources/transports/meta.yaml @@ -8,6 +8,6 @@ input: value: $uuid reverse: True location_id: - schema: str! + schema: str value: reverse: True diff --git a/solar/solar/core/signals.py b/solar/solar/core/signals.py index b3efc593..760522b7 100644 --- a/solar/solar/core/signals.py +++ b/solar/solar/core/signals.py @@ -87,10 +87,16 @@ def location_and_transports(emitter, receiver, orig_mapping): emitter.name, single) return - if emitter_single.get('value') is False: + if emitter_single.get('is_emit') is False: + # this case is when we connect resource to transport itself + # like adding ssh_transport for solard_transport and we don't want then + # transports_id to be messed + # it forbids passing this value around log.debug("Disabled %r mapping for %r", single, emitter.name) return if receiver_single.get('is_own') is False: + # this case is when we connect resource which has location_id but that is + # from another resource log.debug("Not is_own %r for %r ", single, emitter.name) return # connect in other direction