def is_service_cidr_expansion():
    service_cidr_from_db = db.get('kubernetes-master.service-cidr')
    service_cidr_from_config = hookenv.config('service-cidr')
    if (not service_cidr_from_db):
        return False
    if (service_cidr_from_db == service_cidr_from_config):
        return False
    current_networks = kubernetes_common.get_networks(service_cidr_from_db)
    new_networks = kubernetes_common.get_networks(service_cidr_from_config)
    if ((len(current_networks) != len(new_networks)) or (not all((cur.subnet_of(new) for (cur, new) in zip(current_networks, new_networks))))):
        hookenv.log('WARN: New k8s service cidr not superset of old one')
        return False
    return True
def is_service_cidr_expansion():
    service_cidr_from_db = db.get('kubernetes-master.service-cidr')
    service_cidr_from_config = hookenv.config('service-cidr')
    if (not service_cidr_from_db):
        return False
    if (service_cidr_from_db == service_cidr_from_config):
        return False
    current_networks = kubernetes_common.get_networks(service_cidr_from_db)
    new_networks = kubernetes_common.get_networks(service_cidr_from_config)
    if ((len(current_networks) != len(new_networks)) or (not all((cur.subnet_of(new) for (cur, new) in zip(current_networks, new_networks))))):
        hookenv.log('WARN: New k8s service cidr not superset of old one')
        return False
    return True