def main():
    
    totalSuccess = True
    
    # -------------------------------------------------
    # Check arguments
    # -------------------------------------------------
    results = check_args()
    if not results:
        sys.exit(exitErrCode)
    server, port, adminuser, password, useSSL = results
    
    if debug:
        print server, port, adminuser, password, useSSL
    
    try:            
        # ------------------------------------------------- 
        # Get all services that exist on server
        # -------------------------------------------------
        if useSSL:
            protocol = 'https'
        else:
            protocol = 'http'
            
        allServices = getServiceList(server, port, adminuser, password)
        
        # Remove certain services from collection
        #excludeServices = ['SampleWorldCities.MapServer']
        excludeServices = []
        services = [service for service in allServices if excludeServices not in service]
        services = [service.replace('//', '/') for service in allServices]
        
        if len(services) == 0:
            raise Exception('ERROR: There are no user published ArcGIS Server services. Have you published the ArcGIS Server services?')
        
        # -------------------------------------------------
        # List service workspaces
        # -------------------------------------------------
        numServices = len(services)
        i = 0
        
        for service in services:
            i += 1
            print service
        #print 'Total: {}'.format(i)
                    
    except:
        totalSuccess = False
        
        # Get the traceback object
        tb = sys.exc_info()[2]
        tbinfo = traceback.format_tb(tb)[0]
     
        # Concatenate information together concerning the error into a message string
        pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
     
        # Print Python error messages for use in Python / Python Window
        print
        print "***** ERROR ENCOUNTERED *****"
        print pymsg + "\n"
        
    finally:
        if totalSuccess:
            sys.exit(0)
        else:
            sys.exit(1)
dataset/ETHPy150Open Esri/ops-server-config/Utilities/ListServices.py/main/swapped operands of `not in`