def create_connection(self, name='test1', connector_id=1): conn = Connection(name, connector_id) conn.framework = self.client.get_framework().con_forms conn.connector = self.client.get_connectors()[0].con_forms for _connector in conn.connector: for _input in _connector.inputs: if CONNECTION_FORM_VALUES[_input.name]: _input.value = CONNECTION_FORM_VALUES[_input.name] for _framework in conn.framework: for _input in _framework.inputs: if FRAMEWORK_FORM_VALUES[_input.name]: _input.value = FRAMEWORK_FORM_VALUES[_input.name] return self.client.create_connection(conn)
def create_connection(self, name='test1', connector_id=1): conn = Connection(name, connector_id) conn.framework = self.client.get_framework().con_forms conn.connector = self.client.get_connectors()[0].con_forms for _connector in conn.connector: for _input in _connector.inputs: if _input.name not in CONNECTION_FORM_VALUES: LOG.warning("Connection input mapping %s does not exist. Maybe it's new?" % _input.name) elif CONNECTION_FORM_VALUES[_input.name]: _input.value = CONNECTION_FORM_VALUES[_input.name] for _framework in conn.framework: for _input in _framework.inputs: if _input.name not in FRAMEWORK_FORM_VALUES: LOG.warning("Framework input mapping %s does not exist. Maybe it's new?" % _input.name) elif FRAMEWORK_FORM_VALUES[_input.name]: _input.value = FRAMEWORK_FORM_VALUES[_input.name] return self.client.create_connection(conn)
def create_connection(self, name='test1', connector_id=1): conn = Connection(name, connector_id) conn.framework = self.client.get_framework().con_forms conn.connector = self.client.get_connectors()[0].con_forms for _connector in conn.connector: for _input in _connector.inputs: if _input.name not in CONNECTION_FORM_VALUES: LOG.warning( "Connection input mapping %s does not exist. Maybe it's new?" % _input.name) elif CONNECTION_FORM_VALUES[_input.name]: _input.value = CONNECTION_FORM_VALUES[_input.name] for _framework in conn.framework: for _input in _framework.inputs: if _input.name not in FRAMEWORK_FORM_VALUES: LOG.warning( "Framework input mapping %s does not exist. Maybe it's new?" % _input.name) elif FRAMEWORK_FORM_VALUES[_input.name]: _input.value = FRAMEWORK_FORM_VALUES[_input.name] return self.client.create_connection(conn)