# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import stat
import socorro.lib.ConfigurationManager as cm

#-------------------------------------------------------------------------------
# source storage

sourceStorageClass = cm.Option()
sourceStorageClass.doc = 'the fully qualified name of the source storage class'
sourceStorageClass.default = 'socorro.storage.crashstorage.CrashStorageSystemForLocalFS'
sourceStorageClass.fromStringConverter = cm.classConverter

from config.collectorconfig import localFS
from config.collectorconfig import localFSDumpDirCount
from config.collectorconfig import localFSDumpGID
from config.collectorconfig import localFSDumpPermissions
from config.collectorconfig import localFSDirPermissions
from config.collectorconfig import fallbackFS
from config.collectorconfig import fallbackDumpDirCount
from config.collectorconfig import fallbackDumpGID
from config.collectorconfig import fallbackDumpPermissions
from config.collectorconfig import fallbackDirPermissions

from config.commonconfig import jsonFileSuffix
from config.commonconfig import dumpFileSuffix

#-------------------------------------------------------------------------------
# destination storage

destinationStorageClass = cm.Option()
destinationStorageClass.doc = 'the fully qualified name of the source storage class'
destinationStorageClass.default = 'socorro.storage.crashstorage.CrashStorageSystemForHBase'
destinationStorageClass.fromStringConverter = cm.classConverter

from config.commonconfig import hbaseHost
from config.commonconfig import hbasePort
from config.commonconfig import hbaseTimeout

#-------------------------------------------------------------------------------
# general

searchRoot = cm.Option()
searchRoot.doc = 'the file system root at which to start the orphan search'
searchRoot.default = localFS.default

numberOfThreads = cm.Option()
numberOfThreads.doc = 'the number of threads to use'
numberOfThreads.default = 4

dryrun = cm.Option()
dryrun.doc = "if True, don't actually move things into destination"
dryrun.default = False

#-------------------------------------------------------------------------------
# logging

syslogHost = cm.Option()
syslogHost.doc = 'syslog hostname'
syslogHost.default = 'localhost'

syslogPort = cm.Option()
syslogPort.doc = 'syslog port'
syslogPort.default = 514

syslogFacilityString = cm.Option()
syslogFacilityString.doc = 'syslog facility string ("user", "local0", etc)'
syslogFacilityString.default = 'user'

syslogLineFormatString = cm.Option()
syslogLineFormatString.doc = 'python logging system format for syslog entries'
syslogLineFormatString.default = 'Socorro Storage Mover (pid %(process)d): %(asctime)s %(levelname)s - %(threadName)s - %(message)s'

syslogErrorLoggingLevel = cm.Option()
syslogErrorLoggingLevel.doc = 'logging level for the log file (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)'
syslogErrorLoggingLevel.default = 10

stderrLineFormatString = cm.Option()
stderrLineFormatString.doc = 'python logging system format for logging to stderr'
stderrLineFormatString.default = '%(asctime)s %(levelname)s - %(threadName)s - %(message)s'

stderrErrorLoggingLevel = cm.Option()
stderrErrorLoggingLevel.doc = 'logging level for the logging to stderr (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)'
stderrErrorLoggingLevel.default = 10

