title: How we can access any configuration file from other bucket (instead of composer bucket)
body: <p>I am new in python and google composer.
  I am trying to read configuration(.properties) file from google cloud storage from my python script. configuration files contain key &amp; value pair.
  I tried with configparser for reading the config file &amp; normal with operator also
  If same file we have in same composer environment then we can give the path 
  like '/home/airflow/gcs/dags/config.properties' </p>
  
  <p>But for other bucket what path I can give ??</p>
  
  <p>I am trying to access path storage_client using below code</p>
  
  <pre><code>separator = "="
  keys = {}
  
  def iterate_bucket():
      bucket_name = 'other-bucket'
      storage_client = storage.Client.from_service_account_json(
      '/home/airflow/gcs/data/*************.json')
      bucket = storage_client.get_bucket(bucket_name)
      blobs = bucket.list_blobs()
      return blobs
  
  def read_Prop():
      blobs = iterate_bucket()
  
      for blob in blobs:
          if "config.properties" in blob.name:
              print("hello : ", blob.name)
              #file_name = "/home/airflow/gcs/" + blob.name
              file_name = blob.name
  
      with open(file_name, 'r') as f: 
         for line in f:
         if separator in line:
  
              name, value = line.split(separator, 1)
             keys[name.strip()] = value.strip()
  
  print(keys.get('any_key'))
  </code></pre>
  
  <p>I used configparser also</p>
  
  <pre><code>config = configparser.ConfigParser()
  config.read(blob.name)
  </code></pre>
  
  <p>In both the condition for other google cloud storage(bucket) is not accesible from my python script.
  I am getting no such file or directory error</p>
  
  <p>What path we can give or any other way to access ??</p>
  
  <p>Example 2 - </p>
  
  <pre><code>def readYML():
  bucket_name = 'external-bucket'
  storage_client = storage.Client.from_service_account_json(
      '/home/airflow/gcs/data/private-key.json')
  bucket = storage_client.get_bucket(bucket_name)
  file_name = ""
  blobs = bucket.list_blobs()
  print("blobs : ",blobs)
  for blob in blobs:
      if "sample_config.yml" in blob.name:
          print("hello : ", blob.name)
          file_name = blob.name
          print("file_name : ",file_name)
  with open(file_name, 'r') as ymlfile:
      CFG = yaml.load(ymlfile)
      print("inside readYML method : ", CFG['configs']['project_id'])
      return CFG
  </code></pre>
  
  <p>see the logs - Here in print statement file name is coming but when we are reading getting error for NO such file or directory error.</p>
  
  <pre><code>[2020-01-02 12:39:12,853] {base_task_runner.py:101} INFO - Job 11782: 
  Subtask Raw1 [2020-01-02 12:39:12,852] {logging_mixin.py:95} INFO - hello :  
  sample_config.yml
  [2020-01-02 12:39:12,853] {logging_mixin.py:95} INFO - file_name :  
  sample_config.yml
  [2020-01-02 12:39:12,853] {base_task_runner.py:101} INFO - Job 11782: 
  Subtask Raw1 [2020-01-02 12:39:12,853] {logging_mixin.py:95} INFO - 
  file_name :  sample_config.yml
  [2020-01-02 12:39:12,855] {models.py:1846} ERROR - [Errno 2] No such file or 
  directory: 'sample_config.yml'
  </code></pre>
  
  <p>Thanks in advance</p>