Skip to content

DashboardAPI Seems To Retain Prior Instances #113

Description

@timway
import meraki
for r in range(0,2):
    d = meraki.DashboardAPI()

Outputs:

      meraki:     INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.0.0', 'caller': None, 'be_geo_id': None, 'simulate': False, 'maximum_retries': 2, 'retry_4xx_error_wait_time': 60, 'retry_4xx_error': False, 'action_batch_retry_wait_time': 60, 'nginx_429_retry_wait_time': 60, 'wait_on_rate_limit': True, 'requests_proxy': '', 'certificate_path': '', 'single_request_timeout': 60, 'base_url': 'https://api.meraki.com/api/v1', 'api_key': '************************************xxxx'}
      meraki:     INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.0.0', 'caller': None, 'be_geo_id': None, 'simulate': False, 'maximum_retries': 2, 'retry_4xx_error_wait_time': 60, 'retry_4xx_error': False, 'action_batch_retry_wait_time': 60, 'nginx_429_retry_wait_time': 60, 'wait_on_rate_limit': True, 'requests_proxy': '', 'certificate_path': '', 'single_request_timeout': 60, 'base_url': 'https://api.meraki.com/api/v1', 'api_key': '************************************xxxx'}
      meraki:     INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.0.0', 'caller': None, 'be_geo_id': None, 'simulate': False, 'maximum_retries': 2, 'retry_4xx_error_wait_time': 60, 'retry_4xx_error': False, 'action_batch_retry_wait_time': 60, 'nginx_429_retry_wait_time': 60, 'wait_on_rate_limit': True, 'requests_proxy': '', 'certificate_path': '', 'single_request_timeout': 60, 'base_url': 'https://api.meraki.com/api/v1', 'api_key': '************************************xxxx'}

Expected:

      meraki:     INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.0.0', 'caller': None, 'be_geo_id': None, 'simulate': False, 'maximum_retries': 2, 'retry_4xx_error_wait_time': 60, 'retry_4xx_error': False, 'action_batch_retry_wait_time': 60, 'nginx_429_retry_wait_time': 60, 'wait_on_rate_limit': True, 'requests_proxy': '', 'certificate_path': '', 'single_request_timeout': 60, 'base_url': 'https://api.meraki.com/api/v1', 'api_key': '************************************xxxx'}
      meraki:     INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.0.0', 'caller': None, 'be_geo_id': None, 'simulate': False, 'maximum_retries': 2, 'retry_4xx_error_wait_time': 60, 'retry_4xx_error': False, 'action_batch_retry_wait_time': 60, 'nginx_429_retry_wait_time': 60, 'wait_on_rate_limit': True, 'requests_proxy': '', 'certificate_path': '', 'single_request_timeout': 60, 'base_url': 'https://api.meraki.com/api/v1', 'api_key': '************************************xxxx'}

With every additional call of the loop you get another entry in the log. I noticed this when building a Flask application that built a new DashboardAPI() object when the user provided a different API key. I imagine the same thing would happen with multiple users of an application that takes in API keys as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions