source/Tools Integration/CE-Integration/CE-automation-scripts/mfcommon.py [243:300]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if len(aws_accounts) == 0:
            msg = "ERROR: Server list for wave " + waveid + " is empty...."
            print(msg)
            sys.exit()

        # Get server list
        for account in aws_accounts:
            print("### Servers in Target Account: " + account['aws_accountid'] + " , region: " + account['aws_region'] + " ###")
            for app in apps:
                if 'wave_id' in app and 'aws_accountid' in app and 'aws_region' in app:
                    if str(app['wave_id']) == str(waveid):
                        if str(app['aws_accountid']).strip() == str(account['aws_accountid']):
                            if app['aws_region'].lower().strip() == account['aws_region']:
                                for server in servers:
                                    if 'app_id' in server:
                                        if server['app_id'] == app['app_id']:
                                            # verify server_os_family attribute, only accepts Windows or Linux
                                            if 'server_os_family' in server:
                                                # Verify server_fqdn, this is mandatory attribute
                                                if 'server_fqdn' in server:
                                                    if server['server_os_family'].lower() == 'windows':
                                                        account['servers_windows'].append(server)
                                                    elif server['server_os_family'].lower() == 'linux':
                                                        account['servers_linux'].append(server)
                                                    else:
                                                        print("ERROR: Invalid server_os_family for: " + server['server_name'] + ", please select either Windows or Linux")
                                                        sys.exit()
                                                    print(server['server_fqdn'])
                                                else:
                                                    print("ERROR: server_fqdn for server: " + server['server_name'] + " doesn't exist")
                                                    sys.exit()
                                            else:
                                                print("ERROR: server_os_family does not exist for: " + server['server_name'])
                                                sys.exit()
            print("")
            # Check if the server list is empty for both Windows and Linux
            if len(account['servers_windows']) == 0 and len(account['servers_linux']) == 0:
                msg = "ERROR: Server list for wave " + waveid + " and account: " + account['aws_accountid'] + " region: " + account['aws_region'] + " is empty...."
                print(msg)
                sys.exit()
            if len(account['servers_linux']) > 0:
               linux_exist = True
            if len(account['servers_windows']) > 0:
               windows_exist = True
        return aws_accounts, linux_exist, windows_exist
    except botocore.exceptions.ClientError as error:
        if ":" in str(error):
            err = ''
            msgs = str(error).split(":")[1:]
            for msg in msgs:
                err = err + msg
            msg = "ERROR: " + err
            print(msg)
            sys.exit()
        else:
            msg = "ERROR: " + str(error)
            print(msg)
            sys.exit()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/Tools Integration/MGN-Integration/MGN-automation-scripts/0-Prerequisites-checks.py [69:126]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if len(aws_accounts) == 0:
            msg = "ERROR: Server list for wave " + waveid + " is empty...."
            print(msg)
            sys.exit()

        # Get server list
        for account in aws_accounts:
            print("### Servers in Target Account: " + account['aws_accountid'] + " , region: " + account['aws_region'] + " ###")
            for app in apps:
                if 'wave_id' in app and 'aws_accountid' in app and 'aws_region' in app:
                    if str(app['wave_id']) == str(waveid):
                        if str(app['aws_accountid']).strip() == str(account['aws_accountid']):
                            if app['aws_region'].lower().strip() == account['aws_region']:
                                for server in servers:
                                    if 'app_id' in server:
                                        if server['app_id'] == app['app_id']:
                                            # verify server_os_family attribute, only accepts Windows or Linux
                                            if 'server_os_family' in server:
                                                # Verify server_fqdn, this is mandatory attribute
                                                if 'server_fqdn' in server:
                                                    if server['server_os_family'].lower() == 'windows':
                                                        account['servers_windows'].append(server)
                                                    elif server['server_os_family'].lower() == 'linux':
                                                        account['servers_linux'].append(server)
                                                    else:
                                                        print("ERROR: Invalid server_os_family for: " + server['server_name'] + ", please select either Windows or Linux")
                                                        sys.exit()
                                                    print(server['server_fqdn'])
                                                else:
                                                    print("ERROR: server_fqdn for server: " + server['server_name'] + " doesn't exist")
                                                    sys.exit()
                                            else:
                                                print("ERROR: server_os_family does not exist for: " + server['server_name'])
                                                sys.exit()
            print("")
            # Check if the server list is empty for both Windows and Linux
            if len(account['servers_windows']) == 0 and len(account['servers_linux']) == 0:
                msg = "ERROR: Server list for wave " + waveid + " and account: " + account['aws_accountid'] + " region: " + account['aws_region'] + " is empty...."
                print(msg)
                sys.exit()
            if len(account['servers_linux']) > 0:
               linux_exist = True
            if len(account['servers_windows']) > 0:
               windows_exist = True
        return aws_accounts, linux_exist, windows_exist
    except botocore.exceptions.ClientError as error:
        if ":" in str(error):
            err = ''
            msgs = str(error).split(":")[1:]
            for msg in msgs:
                err = err + msg
            msg = "ERROR: " + err
            print(msg)
            sys.exit()
        else:
            msg = "ERROR: " + str(error)
            print(msg)
            sys.exit()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



