def verify_aws_login(self):
        '''Verify AWS login '''
        if ((self.aws_access_key_id == 'YourAccessKeyId') or
                (self.aws_secret_access_key == 'YourSecretAccessKey')):
            return False
        else:
            try:
                self.rdsc.describe_db_instances()
            except botocore.exceptions.ClientError as exception:
                print exception
                return False
            except AttributeError as e:
                print e
                print "*** Unable to establish connection to AWS region %s "\
                    "using your access key/secret key", self.region
                return False
            except boto.exception.BotoServerError as e:
                print "***********************************************************"
                print "WARNING"
                print "Unable to establish connection to AWS RDS (Amazon relational database services)."
                print "See relevant psiturk docs here:"
                print "\thttp://psiturk.readthedocs.io/en/latest/configure_databases.html#obtaining-a-low-cost-or-free-mysql-database-on-amazon-s-web-services-cloud"
                print "***********************************************************"
                return False
            else:
                return True
def verify_aws_login ( self ) : if ( ( self . aws_access_key_id == 'YourAccessKeyId' ) or ( self . aws_secret_access_key == 'YourSecretAccessKey' ) ) : return False else : try : self . rdsc . describe_db_instances ( ) except botocore . exceptions . ClientError as exception : print exception return False except AttributeError as e : print e print "*** Unable to establish connection to AWS region %s " "using your access key/secret key" , self . region return False except boto . exception . BotoServerError as e : print "***********************************************************" print "WARNING" print "Unable to establish connection to AWS RDS (Amazon relational database services)." print "See relevant psiturk docs here:" print "\thttp://psiturk.readthedocs.io/en/latest/configure_databases.html#obtaining-a-low-cost-or-free-mysql-database-on-amazon-s-web-services-cloud" print "***********************************************************" return False else : return True
Verify AWS login