#!/usr/bin/env python # Copyright (C) 2011-2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. import os_client_config from six.moves import configparser as ConfigParser import time import yaml from nodepool import fakeprovider from nodepool import zk class ConfigValue(object): def __eq__(self, other): if isinstance(other, ConfigValue): if other.__dict__ == self.__dict__: return True return False class Config(ConfigValue): pass class Provider(ConfigValue): def __eq__(self, other): if (other.cloud_config != self.cloud_config or other.pools != self.pools or other.image_type != self.image_type or other.rate != self.rate or other.boot_timeout != self.boot_timeout or other.launch_timeout != self.launch_timeout or other.clean_floating_ips != self.clean_floating_ips or other.max_concurrency != self.max_concurrency or other.diskimages != self.diskimages): return False return True def __ne__(self, other): return not self.__eq__(other) def __repr__(self): return "" % self.name class ProviderPool(ConfigValue): def __eq__(self, other): if (other.labels != self.labels or other.max_servers != self.max_servers or other.azs != self.azs or other.networks != self.networks): return False return True def __ne__(self, other): return not self.__eq__(other) def __repr__(self): return "" % self.name class ProviderDiskImage(ConfigValue): def __repr__(self): return "" % self.name class ProviderCloudImage(ConfigValue): def __repr__(self): return "" % self.name class Label(ConfigValue): def __repr__(self): return "