def checkstackname()

in buildstack.py [0:0]


def checkstackname(region):
# checks if stackname exists. Returns true if it does, false if not.
    try:

        client = boto3.client('cloudformation',region_name = region)
        response = client.list_stacks(StackStatusFilter=['CREATE_COMPLETE'])
        for stacks in response['StackSummaries']:
            if (stacks['StackName'] == stackname):
                return True
            else:
                return False
    
    except ClientError as e:
        print("[ERROR]",e)
        raise
    except Exception as e:
        print("[ERROR]", e)