import importlib
import os
import logging
from website import settings


logger = logging.getLogger(__name__)

DEFAULT_REGION_NAME = 'N. Virginia'
DEFAULT_REGION_ID = 'us-east-1'

WATERBUTLER_CREDENTIALS = {
    'storage': {}
}

WATERBUTLER_SETTINGS = {
    'storage': {
        'provider': 'filesystem',
        'folder': os.path.join(settings.BASE_PATH, 'osfstoragecache'),
    }
}

WATERBUTLER_RESOURCE = 'folder'

DISK_SAVING_MODE = settings.DISK_SAVING_MODE


try:
    mod = importlib.import_module('.{}'.format(settings.MIGRATION_ENV), package='addons.osfstorage.settings')
    globals().update({k: getattr(mod, k) for k in dir(mod)})
except Exception as ex:
    logger.warn('No migration settings loaded for OSFStorage, falling back to local dev. {}'.format(ex))

import importlib
import os
import logging
from website import settings


logger = logging.getLogger(__name__)

DEFAULT_REGION_NAME = 'United States'
DEFAULT_REGION_ID = 'us'

WATERBUTLER_CREDENTIALS = {
    'storage': {}
}

WATERBUTLER_SETTINGS = {
    'storage': {
        'provider': 'filesystem',
        'folder': os.path.join(settings.BASE_PATH, 'osfstoragecache'),
    }
}

WATERBUTLER_RESOURCE = 'folder'

DISK_SAVING_MODE = settings.DISK_SAVING_MODE


try:
    mod = importlib.import_module('.{}'.format(settings.MIGRATION_ENV), package='addons.osfstorage.settings')
    globals().update({k: getattr(mod, k) for k in dir(mod)})
except Exception as ex:
    logger.warn('No migration settings loaded for OSFStorage, falling back to local dev. {}'.format(ex))

Adjust OSF Storage default region names
Adjust OSF Storage default region names
  import importlib
  import os
  import logging
  from website import settings
  
  
  logger = logging.getLogger(__name__)
  
- DEFAULT_REGION_NAME = 'N. Virginia'
+ DEFAULT_REGION_NAME = 'United States'
- DEFAULT_REGION_ID = 'us-east-1'
+ DEFAULT_REGION_ID = 'us'
  
  WATERBUTLER_CREDENTIALS = {
      'storage': {}
  }
  
  WATERBUTLER_SETTINGS = {
      'storage': {
          'provider': 'filesystem',
          'folder': os.path.join(settings.BASE_PATH, 'osfstoragecache'),
      }
  }
  
  WATERBUTLER_RESOURCE = 'folder'
  
  DISK_SAVING_MODE = settings.DISK_SAVING_MODE
  
  
  try:
      mod = importlib.import_module('.{}'.format(settings.MIGRATION_ENV), package='addons.osfstorage.settings')
      globals().update({k: getattr(mod, k) for k in dir(mod)})
  except Exception as ex:
      logger.warn('No migration settings loaded for OSFStorage, falling back to local dev. {}'.format(ex))
  
Adjust OSF Storage default region names
## Code Before:
import importlib
import os
import logging
from website import settings


logger = logging.getLogger(__name__)

DEFAULT_REGION_NAME = 'N. Virginia'
DEFAULT_REGION_ID = 'us-east-1'

WATERBUTLER_CREDENTIALS = {
    'storage': {}
}

WATERBUTLER_SETTINGS = {
    'storage': {
        'provider': 'filesystem',
        'folder': os.path.join(settings.BASE_PATH, 'osfstoragecache'),
    }
}

WATERBUTLER_RESOURCE = 'folder'

DISK_SAVING_MODE = settings.DISK_SAVING_MODE


try:
    mod = importlib.import_module('.{}'.format(settings.MIGRATION_ENV), package='addons.osfstorage.settings')
    globals().update({k: getattr(mod, k) for k in dir(mod)})
except Exception as ex:
    logger.warn('No migration settings loaded for OSFStorage, falling back to local dev. {}'.format(ex))

## Instruction:
Adjust OSF Storage default region names
## Code After:
import importlib
import os
import logging
from website import settings


logger = logging.getLogger(__name__)

DEFAULT_REGION_NAME = 'United States'
DEFAULT_REGION_ID = 'us'

WATERBUTLER_CREDENTIALS = {
    'storage': {}
}

WATERBUTLER_SETTINGS = {
    'storage': {
        'provider': 'filesystem',
        'folder': os.path.join(settings.BASE_PATH, 'osfstoragecache'),
    }
}

WATERBUTLER_RESOURCE = 'folder'

DISK_SAVING_MODE = settings.DISK_SAVING_MODE


try:
    mod = importlib.import_module('.{}'.format(settings.MIGRATION_ENV), package='addons.osfstorage.settings')
    globals().update({k: getattr(mod, k) for k in dir(mod)})
except Exception as ex:
    logger.warn('No migration settings loaded for OSFStorage, falling back to local dev. {}'.format(ex))
