<s> import logging <EOL> import sys <EOL> from django . core . management . base import NoArgsCommand <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . db import connections <EOL> from django . db . utils import OperationalError <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class Command ( NoArgsCommand ) : <EOL> help = """<STR_LIT>""" <EOL> def handle_noargs ( self , ** options ) : <EOL> self . stdout . write ( '<STR_LIT>' ) <EOL> try : <EOL> db_conn = connections [ '<STR_LIT:default>' ] <EOL> db_conn . cursor ( ) <EOL> except ImproperlyConfigured : <EOL> sys . exit ( <NUM_LIT:3> ) <EOL> except OperationalError , e : <EOL> self . stdout . write ( '<STR_LIT>' % e ) <EOL> if e . args [ <NUM_LIT:0> ] == <NUM_LIT> : <EOL> sys . exit ( <NUM_LIT:5> ) <EOL> elif e . args [ <NUM_LIT:0> ] == <NUM_LIT> : <EOL> sys . exit ( <NUM_LIT:6> ) <EOL> elif e . args [ <NUM_LIT:0> ] == <NUM_LIT> : <EOL> sys . exit ( <NUM_LIT:7> ) <EOL> elif e . args [ <NUM_LIT:0> ] == <NUM_LIT> : <EOL> sys . exit ( <NUM_LIT:8> ) <EOL> else : <EOL> sys . exit ( <NUM_LIT:4> ) <EOL> except Exception , e : <EOL> self . stdout . write ( '<STR_LIT>' % e ) <EOL> error = str ( e ) <EOL> if '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:5> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:6> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:7> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:8> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:4> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:5> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:6> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:7> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:8> ) <EOL> elif '<STR_LIT>' in error : <EOL> sys . exit ( <NUM_LIT:4> ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> self . stdout . write ( '<STR_LIT>' ) </s>
