Example #1
0
def get_classic_services_that_run_here():
    # find all files in the PUPPET_SERVICE_DIR, but discard broken symlinks
    # this allows us to (de)register services on a machine by
    # breaking/healing a symlink placed by Puppet.
    puppet_service_dir_services = set()
    if os.path.exists(PUPPET_SERVICE_DIR):
        puppet_service_dir_services = {
            i for i in os.listdir(PUPPET_SERVICE_DIR) if os.path.exists(os.path.join(PUPPET_SERVICE_DIR, i))
        }

    return sorted(service_configuration_lib.services_that_run_here() | puppet_service_dir_services)
Example #2
0
def get_classic_services_running_here_for_nerve(soa_dir):
    classic_services = []
    classic_services_here = service_configuration_lib.services_that_run_here()
    for service in sorted(classic_services_here):
        namespaces = [x[0] for x in get_all_namespaces_for_service(
            service, soa_dir, full_name=False)]
        for namespace in namespaces:
            classic_services.append(
                _namespaced_get_classic_service_information_for_nerve(
                    service, namespace, soa_dir)
            )
    return classic_services
Example #3
0
def get_classic_services_running_here_for_nerve(soa_dir):
    classic_services = []
    classic_services_here = service_configuration_lib.services_that_run_here()
    for service in sorted(classic_services_here):
        namespaces = [x[0] for x in get_all_namespaces_for_service(
            service, soa_dir, full_name=False)]
        for namespace in namespaces:
            classic_services.append(
                _namespaced_get_classic_service_information_for_nerve(
                    service, namespace, soa_dir)
            )
    return classic_services
Example #4
0
def get_classic_services_that_run_here():
    # find all files in the PUPPET_SERVICE_DIR, but discard broken symlinks
    # this allows us to (de)register services on a machine by
    # breaking/healing a symlink placed by Puppet.
    puppet_service_dir_services = set()
    if os.path.exists(PUPPET_SERVICE_DIR):
        puppet_service_dir_services = {
            i
            for i in os.listdir(PUPPET_SERVICE_DIR)
            if os.path.exists(os.path.join(PUPPET_SERVICE_DIR, i))
        }

    return sorted(service_configuration_lib.services_that_run_here()
                  | puppet_service_dir_services)