Mikhail created AIRFLOW-6164:
--------------------------------

             Summary: airflow connections add fails if spaces are present in 
conn_extra argument
                 Key: AIRFLOW-6164
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6164
             Project: Apache Airflow
          Issue Type: Bug
          Components: webserver
    Affects Versions: 1.10.6
            Reporter: Mikhail


When creating a new connection from cli:
{code:java}
airflow connections -a --conn_id test1 --conn_type google_cloud_platform 
--conn_extra '{"extra__jdbc__drv_path": "", "extra__jdbc__drv_clsname": "", 
"extra__google_cloud_platform__project": "my-project", 
"extra__google_cloud_platform__key_path": "", 
"extra__google_cloud_platform__keyfile_dict": "{     
\\"auth_provider_x509_cert_url\\": 
\\"https://www.googleapis.com/oauth2/v1/certs\\";,     \\"auth_uri\\": 
\\"https://accounts.google.com/o/oauth2/auth\\";,     \\"client_email\\": 
\\"email@com\\",     \\"client_id\\": \\"123456\\",     
\\"client_x509_cert_url\\": 
\\"https://www.googleapis.com/robot/v1/metadata/x509/blahblah\\";,     
\\"private_key\\": \\"-----BEGIN PRIVATE KEY-----\\\\nMI0yM8=\\\\n-----END 
PRIVATE KEY-----\\\\n\\",     \\"private_key_id\\": \\"123456789\\",     
\\"project_id\\": \\"my_project\\",     \\"token_uri\\": 
\\"https://oauth2.googleapis.com/token\\";,     \\"type\\": 
\\"service_account\\" }", "extra__google_cloud_platform__scope": "", 
"extra__google_cloud_platform__num_retries": 5, "extra__grpc__auth_type": "", 
"extra__grpc__credential_pem_file": "", "extra__grpc__scopes": ""}'
{code}
or even
{code:java}
airflow connections -a --conn_id test2 --conn_type google_cloud_platform 
--conn_extra '{"asd asd":"sdf"}'
{code}
it fails with
{code:java}
airflow-1-10: error: unrecognized arguments: "", "extra__jdbc__drv_clsname": 
"", "extra__google_cloud_platform__project": "my-project", 
"extra__google_cloud_platform__key_path": "", 
"extra__google_cloud_platform__keyfile_dict": "{ 
\\"auth_provider_x509_cert_url\\": 
\\"https://www.googleapis.com/oauth2/v1/certs\\";, \\"auth_uri\\": 
\\"https://accounts.google.com/o/oauth2/auth\\";, \\"client_email\\": 
\\"email@com\\", \\"client_id\\": \\"123456\\", \\"client_x509_cert_url\\": 
\\"https://www.googleapis.com/robot/v1/metadata/x509/blahblah\\";, 
\\"private_key\\": \\"-----BEGIN PRIVATE KEY-----\\\\nMI0yM8=\\\\n-----END 
PRIVATE KEY-----\\\\n\\", \\"private_key_id\\": \\"123456789\\", 
\\"project_id\\": \\"my_project\\", \\"token_uri\\": 
\\"https://oauth2.googleapis.com/token\\";, \\"type\\": \\"service_account\\" 
}", "extra__google_cloud_platform__scope": "", 
"extra__google_cloud_platform__num_retries": 5, "extra__grpc__auth_type": "", 
"extra__grpc__credential_pem_file": "", "extra__grpc__scopes": ""}

{code}
or
{code:java}
airflow-1-10: error: unrecognized arguments: asd":"sdf"}
{code}
accordingly.

The same commands works perfect in airflow 1.10.2.

I'm not sure in which version this was broken.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to