def app_backup(storage, full_bucket_name=None):
  # Create app backups dir if it doesn't exist.
  if not makedirs(APP_BACKUP_DIR_LOCATION):
    logging.warning("Dir '{0}' already exists. Skipping dir creation...".
      format(APP_BACKUP_DIR_LOCATION))

  for dir_path, _, filenames in os.walk(APP_DIR_LOCATION):
    for filename in filenames:
      # Copy source code tars to backups location.
      source = '{0}/{1}'.format(dir_path, filename)
      destination = '{0}/{1}'.format(APP_BACKUP_DIR_LOCATION, filename)
      try:
        shutil.copy(source, destination)
      except:
        logging.error("Error while backing up '{0}'. ".format(source))
        delete_app_tars(APP_BACKUP_DIR_LOCATION)
        return False

      # Upload to GCS.
      if storage == StorageTypes.GCS:
        source = '{0}/{1}'.format(APP_DIR_LOCATION, filename)
        destination = '{0}/apps/{1}'.format(full_bucket_name, filename)
        logging.debug("Destination: {0}".format(destination))
        if not gcs_helper.upload_to_bucket(destination, source):
          logging.error("Error while uploading '{0}' to GCS. ".format(source))
          delete_app_tars(APP_BACKUP_DIR_LOCATION)
          return False
  return True
Check mac is mac address formatted.
dataset/ETHPy150Open AppScale/appscale/AppDB/backup/backup_recovery_helper.py/app_backup--crossover with--dataset/ETHPy150Open openstack/compass-core/compass/db/api/utils.py/check_mac