Exemplo n.º 1
0
    def handle(self, **options):
        if options['logger']:
            logger = logging.getLogger(options['logger'])
        else:
            logger = logger_runner
       
        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s"%options)
        
        if options['inerror']:
            q=CDR.extractinerror.all()[:options['records']]
        else:
            if options['force']:
                q=CDR.extractforce.all()[:options['records']]
            else:
                q=CDR.extract.all()[:options['records']]
            
        date=datenow().strftime(DATE_FORMAT)
        
        try:
            error=CDR.set_cdr(q, force=options['force'])
            ret={'info':'Successfully set CDRs %s %s'%(error['cdrs'], error['cdrserror']), 'error':error['error'], 'date':date}
        except:
            ret={'info':'Error set CDRs', 'error':traceback.format_exc(), 'date':date}    

        ret=json.dumps(ret)
        self.stdout.write(ret)
        return ret
Exemplo n.º 2
0
    def handle(self, *args, **options):
        if options['debug'] == True:
            logdebug()

        logger.debug("options=%s" % options)

        if options['telco'] is None:
            lsttelco = Telco.objects.all()
            self.stdout.write(40 * '-')
            for t in lsttelco:
                self.stdout.write("Telco %s" % t)
            self.stdout.write(40 * '-')
            raise CommandError("Please specifie option telco")
        else:
            try:
                self.telco = Telco.objects.get(pk=options['telco'])
            except:
                self.stdout.write(Telco.info_telcos())
                raise CommandError("Telco not found")

        if options['typezone'] is None or not options[
                'typezone'] in list_typezone():
            logger.error("typezone \n%s" % info_typezone())
            raise CommandError("Please specifie option typezone")

#        if options['bizzone'] is None:
#            logger.error("bizzone \n%s"%info_bizzone())
#            raise CommandError("Please specifie option bizzone")

        if options['infoconfig'] is None:
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("InfoConfig not found")

        try:
            self.infoconfig = ConfigImport.objects.get(
                pk=options['infoconfig'])
            logger.debug("infoconfig=%s" % self.infoconfig)
        except (ObjectDoesNotExist, ValueError) as e:
            logger.error("ConfigImport Info %s %s" %
                         (options['infoconfig'], e))
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("Please specifie option config")

        if options['filename'] is None:
            raise CommandError("Filename not found")

        try:
            ie_Price().import_price(type=options['typezone'],
                                    fromtelco=self.telco,
                                    config=self.infoconfig,
                                    filename=options['filename'],
                                    force=options['force'])
        except Exception, e:
            raise CommandError("%s" % e)
    def handle(self, *args, **options):

        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s" % options)

        self.workdate = datenow()
        logger.info("WORKDATE %s" % self.workdate)

        if options['reseller'] is None:
            lst = Reseller.objects.all()
            self.stdout.write(40 * '-')
            for t in lst:
                self.stdout.write("Reseller %s" % t)
            self.stdout.write(40 * '-')
            raise CommandError("Please specifie option reseller")
        else:
            try:
                self.reseller = Reseller.objects.get(pk=options['reseller'])
            except:
                self.stdout.write(Reseller.info_resellers())
                raise CommandError("Reseller not found")

        if options['infoconfig'] is None:
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("InfoConfig not found")

        try:
            self.infoconfig = ConfigImport.objects.get(
                pk=options['infoconfig'])
            logger.debug("infoconfig=%s" % self.infoconfig)
        except (ObjectDoesNotExist, ValueError) as e:
            logger.error("ConfigImport Info %s %s" %
                         (options['infoconfig'], e))
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("Please specifie option config")

        if options['filename'] is None:
            raise CommandError("Filename not found")

        if options['contrat']:
            self.myfunc = ie_Customer().import_contrat
        else:
            self.myfunc = ie_Customer().import_customer

        try:
            self.myfunc(reseller=self.reseller,
                        config=self.infoconfig,
                        filename=options['filename'],
                        force=options['force'])
        except Exception, e:
            raise CommandError("%s" % e)
Exemplo n.º 4
0
    def handle(self, *args, **options):
        if options['debug'] == True:
            logdebug()

        logger.debug("options=%s"%options)

        if options['telco'] is None:
            lsttelco = Telco.objects.all()
            self.stdout.write(40 * '-')
            for t in lsttelco:
                self.stdout.write("Telco %s"%t)
            self.stdout.write(40 * '-')
            raise CommandError("Please specifie option telco")
        else:
            try:
                self.telco=Telco.objects.get(pk=options['telco'])
            except:
                self.stdout.write(Telco.info_telcos())
                raise CommandError("Telco not found")

        if options['typezone'] is None or not options['typezone'] in list_typezone():
            logger.error("typezone \n%s"%info_typezone())
            raise CommandError("Please specifie option typezone")

#        if options['bizzone'] is None:
#            logger.error("bizzone \n%s"%info_bizzone())
#            raise CommandError("Please specifie option bizzone")
 
        if options['infoconfig'] is None:
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("InfoConfig not found")

        try:
            self.infoconfig = ConfigImport.objects.get(pk=options['infoconfig'])
            logger.debug("infoconfig=%s"%self.infoconfig)
        except (ObjectDoesNotExist, ValueError) as e:
            logger.error("ConfigImport Info %s %s"%(options['infoconfig'], e))
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("Please specifie option config")

        if options['filename'] is None:
            raise CommandError("Filename not found")
        
        try:
            ie_Price().import_price(type=options['typezone'],
                    fromtelco=self.telco, config=self.infoconfig,
                    filename=options['filename'], force=options['force'])
        except Exception, e:
            raise CommandError("%s"%e)
    def handle(self, *args, **options):
          
        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s"%options)
        
        self.workdate = datenow()
        logger.info("WORKDATE %s"%self.workdate)
        
        if options['reseller'] is None:
            lst = Reseller.objects.all()
            self.stdout.write(40 * '-')
            for t in lst:
                self.stdout.write("Reseller %s"%t)
            self.stdout.write(40 * '-')
            raise CommandError("Please specifie option reseller")
        else:
            try:
                self.reseller=Reseller.objects.get(pk=options['reseller'])
            except:
                self.stdout.write(Reseller.info_resellers())
                raise CommandError("Reseller not found")

        
        if options['infoconfig'] is None:
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("InfoConfig not found")

        try:
            self.infoconfig = ConfigImport.objects.get(pk=options['infoconfig'])
            logger.debug("infoconfig=%s"%self.infoconfig)
        except (ObjectDoesNotExist, ValueError) as e:
            logger.error("ConfigImport Info %s %s"%(options['infoconfig'], e))
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("Please specifie option config")

        if options['filename'] is None:
            raise CommandError("Filename not found")

        if options['contrat']:
            self.myfunc = ie_Customer().import_contrat
        else:
            self.myfunc = ie_Customer().import_customer
        
        try:
            self.myfunc(reseller=self.reseller, config=self.infoconfig,
                    filename=options['filename'], force=options['force'])
        except Exception, e:
            raise CommandError("%s"%e)
Exemplo n.º 6
0
    def handle(self, *args, **options):
        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s"%options)

        if options['reseller'] is None:
            logger.error("reseller \n%s"%Reseller.info_resellers())
            raise CommandError("Please specifie option reseller")
        
        try:
            resel=Reseller.objects.get(id=options['reseller'])
        except ObjectDoesNotExist:
            logger.error("reseller \n%s"%Reseller.info_resellers())
            raise CommandError("Please specifie option reseller")
            
        ie_Cdr().export_cdr(reseller=resel, datefrom=options['datefrom'], dateto=options['dateto'])
        self.stdout.write('Successfully export CDRs')
Exemplo n.º 7
0
    def handle(self, *args, **options):
        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s" % options)

        if options['reseller'] is None:
            logger.error("reseller \n%s" % Reseller.info_resellers())
            raise CommandError("Please specifie option reseller")

        try:
            resel = Reseller.objects.get(id=options['reseller'])
        except ObjectDoesNotExist:
            logger.error("reseller \n%s" % Reseller.info_resellers())
            raise CommandError("Please specifie option reseller")

        ie_Cdr().export_cdr(reseller=resel,
                            datefrom=options['datefrom'],
                            dateto=options['dateto'])
        self.stdout.write('Successfully export CDRs')
Exemplo n.º 8
0
    def handle(self, **options):
        if options['logger']:
            logger = logging.getLogger(options['logger'])
        else:
            logger = logger_runner

        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s" % options)

        if options['inerror']:
            q = CDR.extractinerror.all()[:options['records']]
        else:
            if options['force']:
                q = CDR.extractforce.all()[:options['records']]
            else:
                q = CDR.extract.all()[:options['records']]

        date = datenow().strftime(DATE_FORMAT)

        try:
            error = CDR.set_cdr(q, force=options['force'])
            ret = {
                'info':
                'Successfully set CDRs %s %s' %
                (error['cdrs'], error['cdrserror']),
                'error':
                error['error'],
                'date':
                date
            }
        except:
            ret = {
                'info': 'Error set CDRs',
                'error': traceback.format_exc(),
                'date': date
            }

        ret = json.dumps(ret)
        self.stdout.write(ret)
        return ret
Exemplo n.º 9
0
    def handle(self, *args, **options):

        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s" % options)

        if options['grilleprice']:
            options['grillename'] = options['grilleclient'] = False

        if options['grilleclient']:
            options['grillename'] = options['grilleprice'] = False

        self.workdate = datenow()
        logger.info("WORKDATE %s" % self.workdate)

        if options['reseller'] is None:
            lst = Reseller.objects.all()
            self.stdout.write(40 * '-')
            for t in lst:
                self.stdout.write("Reseller %s" % t)
            self.stdout.write(40 * '-')
            raise CommandError("Please specifie option reseller")
        else:
            try:
                self.reseller = Reseller.objects.get(pk=options['reseller'])
            except:
                self.stdout.write(Reseller.info_resellers())
                raise CommandError("Reseller not found")

        if options['ga'] is None and options['grillename']:
            lst = GA_Telco.objects.all()
            self.stdout.write(40 * '-')
            for t in lst:
                self.stdout.write("Grille Achat %s" % t)
            self.stdout.write(40 * '-')
            raise CommandError("Please specifie option ga")
        else:
            if options['ga'] and options['grillename']:
                try:
                    self.ga = GA_Telco.objects.get(pk=options['ga'])
                except:
                    self.stdout.write(GA_Telco.info_gas())
                    raise CommandError("GA_Telco not found")

        if options['infoconfig'] is None:
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("InfoConfig not found")

        try:
            self.infoconfig = ConfigImport.objects.get(
                pk=options['infoconfig'])
            logger.debug("infoconfig=%s" % self.infoconfig)
        except (ObjectDoesNotExist, ValueError) as e:
            logger.error("ConfigImport Info %s %s" %
                         (options['infoconfig'], e))
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("Please specifie option config")

        if options['filename'] is None:
            raise CommandError("Filename not found")

        try:
            if options['grillename']:
                ie_Grille().import_grillename(reseller=self.reseller,
                                              ga=self.ga,
                                              config=self.infoconfig,
                                              filename=options['filename'],
                                              force=options['force'])

            if options['grilleprice']:
                ie_Grille().import_grilleprice(reseller=self.reseller,
                                               config=self.infoconfig,
                                               filename=options['filename'],
                                               force=options['force'])

            if options['grilleclient']:
                ie_Grille().import_grilleclient(reseller=self.reseller,
                                                config=self.infoconfig,
                                                filename=options['filename'],
                                                force=options['force'])

        except Exception, e:
            raise CommandError("%s" % e)
Exemplo n.º 10
0
    def handle(self, *args, **options):
        if getattr(settings, "DEBUG", False):
            self.djangodebug = True

        if options["debug"] == True:
            logdebug()
        logger.debug("options=%s" % options)

        self.workdate = datenow()
        logger.info("WORKDATE %s" % self.workdate)

        if options["auto"] is False:  # automatic, TelcoInjectors par Telco
            logger.debug("NO AUTO")
            if options["telco"] is None:
                lsttelco = Telco.objects.all()
                self.stdout.write(40 * "-")
                for t in lsttelco:
                    self.stdout.write("Telco %s" % t)
                self.stdout.write(40 * "-")
                raise CommandError("Please specifie option telco")
            else:
                try:
                    self.telco = Telco.objects.get(pk=options["telco"])
                except ObjectDoesNotExist, e:
                    self.stdout.write(Telco.info_telcos())
                    raise CommandError("Telco not found")

            # if options['bizzone'] is None:
            #  logger.error("bizzone \n%s"%info_bizzone())
            #  raise CommandError("Please specifie option bizzone")

            if options["injector"] is None:
                lsttelco = Telco.objects.all()
                for t in lsttelco:
                    if t.injectors:
                        self.stdout.write(40 * "-")
                        self.stdout.write("Telco %s" % t)
                        for p in t.injectors.all():
                            self.stdout.write(
                                "Injectors : %s"
                                % "(%s) %s [%s] [%s]"
                                % (int(p.id), p.name, p.get_bizzone_display(), p.get_typeconnexion_display())
                            )
                        self.stdout.write(40 * "-")
                raise CommandError("Please specifie option injector")

            try:
                self.telcoinjector = TelcoInjector.objects.get(pk=options["injector"])
                logger.debug("injector=%s" % self.telcoinjector)
                if options["extention"]:
                    self.extention = options["extention"]
                else:
                    self.extention = self.telcoinjector.get_typefile_display()

                if options["filename"]:
                    self.thelist = glob.glob(options["filename"])
                else:
                    if options["directory"]:
                        self.directory = options["directory"]
                    else:
                        self.directory = normpath(self.telcoinjector.path_dest)

                    logger.debug(
                        "directory=%s extention=%s list=%s"
                        % (self.directory, self.extention, self.get_files(self.directory, self.extention))
                    )

            except ObjectDoesNotExist, e:
                logger.error("Telco Injector Info %s %s" % (options["injector"], e))
                raise CommandError("Please specifie option injector")
Exemplo n.º 11
0
    def handle(self, *args, **options):
        ret = {}     
        datefrom = dateto = cdrmanager = None
        reseller = client = context = None
        
        if options['logger']:
            logger = logging.getLogger(options['logger'])
        else:
            logger = logger_runner
            
        if options['debug'] == True:
            logdebug()

        logger.debug("options=%s"%options)
        q=None

        if options["datefrom"]:
            datefrom = datefromstring(options["datefrom"]+" 00:00:00", short=False)

        if options["dateto"]:
            dateto = datefromstring(options["dateto"]+" 23:59:59", short=False)
        
        if options["reseller"]:
            reseller = options["reseller"]
        
        if options["client"]:
            client = options["client"]
        
        if options['cdr']:
            q = CDR.objects.filter(id=options['cdr'])
        else:
            if options['context'] == 'Telco':
                if options['force']==False:
                    cdrmanager = CDR.valo
                    
                else:
                    cdrmanager = CDR.valoforce
            else:
                cdrmanager = CDR.valoresel
                
            if datefrom and dateto:
                q=cdrmanager.filter(sessiondate__range=(datefrom, dateto))
            elif datefrom and dateto == None:
                q=cdrmanager.filter(sessiondate__gte=datefrom)
            elif datefrom == None and dateto:
                q=cdrmanager.filter(sessiondate__lte=dateto)
            else:
                q=cdrmanager.all()
            
            if client or reseller:
                if client:
                    client = Client.objects.get(code=client)
                    q = q.filter(client=client)
                if reseller:
                    reseller = Reseller.objects.get(code=reseller)
                    q = q.filter(reseller=reseller)
                    options['context'] = 'Resel'
        
        q = q[:options["records"]]
        cdrcount = q.count()
        date=datenow()
        
        try:
            error=valo_CDR(context=options['context']).set_valo(q, date=date, logger=logger)
            ret={'info':'Successfully Valo Resel (nb=%s)'%cdrcount, 'error':error, 'date':date.strftime(DATE_FORMAT)}
        except:
            ret={'info':'Error Valo Resel (nb=%s)'%cdrcount, 'error':traceback.format_exc(), 'date':date.strftime(DATE_FORMAT)}

        ret = json.dumps(ret)
        self.stdout.write(ret)
        return ret
Exemplo n.º 12
0
    def handle(self, *args, **options):
        if getattr(settings, 'DEBUG', False):
            self.djangodebug = True

        if options['debug'] == True:
            logdebug()
        logger.debug("options=%s" % options)

        self.workdate = datenow()
        logger.info("WORKDATE %s" % self.workdate)

        if options['auto'] is False:  #automatic, TelcoInjectors par Telco
            logger.debug("NO AUTO")
            if options['telco'] is None:
                lsttelco = Telco.objects.all()
                self.stdout.write(40 * '-')
                for t in lsttelco:
                    self.stdout.write("Telco %s" % t)
                self.stdout.write(40 * '-')
                raise CommandError("Please specifie option telco")
            else:
                try:
                    self.telco = Telco.objects.get(pk=options['telco'])
                except ObjectDoesNotExist, e:
                    self.stdout.write(Telco.info_telcos())
                    raise CommandError("Telco not found")

            #if options['bizzone'] is None:
            #  logger.error("bizzone \n%s"%info_bizzone())
            #  raise CommandError("Please specifie option bizzone")

            if options['injector'] is None:
                lsttelco = Telco.objects.all()
                for t in lsttelco:
                    if t.injectors:
                        self.stdout.write(40 * '-')
                        self.stdout.write("Telco %s" % t)
                        for p in t.injectors.all():
                            self.stdout.write(
                                "Injectors : %s" % "(%s) %s [%s] [%s]" %
                                (int(p.id), p.name, p.get_bizzone_display(),
                                 p.get_typeconnexion_display()))
                        self.stdout.write(40 * '-')
                raise CommandError("Please specifie option injector")

            try:
                self.telcoinjector = TelcoInjector.objects.get(
                    pk=options['injector'])
                logger.debug("injector=%s" % self.telcoinjector)
                if options['extention']:
                    self.extention = options['extention']
                else:
                    self.extention = self.telcoinjector.get_typefile_display()

                if options['filename']:
                    self.thelist = glob.glob(options['filename'])
                else:
                    if options['directory']:
                        self.directory = options['directory']
                    else:
                        self.directory = normpath(self.telcoinjector.path_dest)

                    logger.debug(
                        "directory=%s extention=%s list=%s" %
                        (self.directory, self.extention,
                         self.get_files(self.directory, self.extention)))

            except ObjectDoesNotExist, e:
                logger.error("Telco Injector Info %s %s" %
                             (options['injector'], e))
                raise CommandError("Please specifie option injector")
Exemplo n.º 13
0
    def handle(self, *args, **options):
        ret = {}
        datefrom = dateto = cdrmanager = None
        reseller = client = context = None

        if options['logger']:
            logger = logging.getLogger(options['logger'])
        else:
            logger = logger_runner

        if options['debug'] == True:
            logdebug()

        logger.debug("options=%s" % options)
        q = None

        if options["datefrom"]:
            datefrom = datefromstring(options["datefrom"] + " 00:00:00",
                                      short=False)

        if options["dateto"]:
            dateto = datefromstring(options["dateto"] + " 23:59:59",
                                    short=False)

        if options["reseller"]:
            reseller = options["reseller"]

        if options["client"]:
            client = options["client"]

        if options['cdr']:
            q = CDR.objects.filter(id=options['cdr'])
        else:
            if options['context'] == 'Telco':
                if options['force'] == False:
                    cdrmanager = CDR.valo

                else:
                    cdrmanager = CDR.valoforce
            else:
                cdrmanager = CDR.valoresel

            if datefrom and dateto:
                q = cdrmanager.filter(sessiondate__range=(datefrom, dateto))
            elif datefrom and dateto == None:
                q = cdrmanager.filter(sessiondate__gte=datefrom)
            elif datefrom == None and dateto:
                q = cdrmanager.filter(sessiondate__lte=dateto)
            else:
                q = cdrmanager.all()

            if client or reseller:
                if client:
                    client = Client.objects.get(code=client)
                    q = q.filter(client=client)
                if reseller:
                    reseller = Reseller.objects.get(code=reseller)
                    q = q.filter(reseller=reseller)
                    options['context'] = 'Resel'

        q = q[:options["records"]]
        cdrcount = q.count()
        date = datenow()

        try:
            error = valo_CDR(context=options['context']).set_valo(
                q, date=date, logger=logger)
            ret = {
                'info': 'Successfully Valo Resel (nb=%s)' % cdrcount,
                'error': error,
                'date': date.strftime(DATE_FORMAT)
            }
        except:
            ret = {
                'info': 'Error Valo Resel (nb=%s)' % cdrcount,
                'error': traceback.format_exc(),
                'date': date.strftime(DATE_FORMAT)
            }

        ret = json.dumps(ret)
        self.stdout.write(ret)
        return ret
Exemplo n.º 14
0
# -*- coding: utf-8 -*-
"""
Author: Philippe 'paHpa' Vivien <*****@*****.**>

Copyright: Nerim, 2014
"""
from __future__ import unicode_literals

from django.conf import settings

from runner.utils.logger import logger, logdebug
logdebug()

class DatabaseAppsRouter(object):
    """
    A router to control all database operations on models for different
    databases.
 
    In case an app is not set in settings.DATABASE_APPS_MAPPING, the router
    will fallback to the `default` database.
 
    Settings example:
 
    DATABASE_APPS_MAPPING = {'app1': 'db1', 'app2': 'db2'}
    """
 
    def db_for_read(self, model, **hints):
        """"Point all read operations to the specific database."""
        logger.debug('self=%s model=%s' % (self, model.__dict__))
        if settings.DATABASE_APPS_MAPPING.has_key(model._meta.app_label):
            return settings.DATABASE_APPS_MAPPING[model._meta.app_label]
Exemplo n.º 15
0
# -*- coding: utf-8 -*-
"""
Author: Philippe 'paHpa' Vivien <*****@*****.**>

Copyright: Nerim, 2014
"""
from __future__ import unicode_literals

from django.conf import settings

from runner.utils.logger import logger, logdebug

logdebug()


class DatabaseAppsRouter(object):
    """
    A router to control all database operations on models for different
    databases.
 
    In case an app is not set in settings.DATABASE_APPS_MAPPING, the router
    will fallback to the `default` database.
 
    Settings example:
 
    DATABASE_APPS_MAPPING = {'app1': 'db1', 'app2': 'db2'}
    """

    def db_for_read(self, model, **hints):
        """"Point all read operations to the specific database."""
        logger.debug("self=%s model=%s" % (self, model.__dict__))
Exemplo n.º 16
0
    def handle(self, *args, **options):

        if options["debug"] == True:
            logdebug()
        logger.debug("options=%s" % options)

        if options["grilleprice"]:
            options["grillename"] = options["grilleclient"] = False

        if options["grilleclient"]:
            options["grillename"] = options["grilleprice"] = False

        self.workdate = datenow()
        logger.info("WORKDATE %s" % self.workdate)

        if options["reseller"] is None:
            lst = Reseller.objects.all()
            self.stdout.write(40 * "-")
            for t in lst:
                self.stdout.write("Reseller %s" % t)
            self.stdout.write(40 * "-")
            raise CommandError("Please specifie option reseller")
        else:
            try:
                self.reseller = Reseller.objects.get(pk=options["reseller"])
            except:
                self.stdout.write(Reseller.info_resellers())
                raise CommandError("Reseller not found")

        if options["ga"] is None and options["grillename"]:
            lst = GA_Telco.objects.all()
            self.stdout.write(40 * "-")
            for t in lst:
                self.stdout.write("Grille Achat %s" % t)
            self.stdout.write(40 * "-")
            raise CommandError("Please specifie option ga")
        else:
            if options["ga"] and options["grillename"]:
                try:
                    self.ga = GA_Telco.objects.get(pk=options["ga"])
                except:
                    self.stdout.write(GA_Telco.info_gas())
                    raise CommandError("GA_Telco not found")

        if options["infoconfig"] is None:
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("InfoConfig not found")

        try:
            self.infoconfig = ConfigImport.objects.get(pk=options["infoconfig"])
            logger.debug("infoconfig=%s" % self.infoconfig)
        except (ObjectDoesNotExist, ValueError) as e:
            logger.error("ConfigImport Info %s %s" % (options["infoconfig"], e))
            self.stdout.write(ConfigImport.info_configimport())
            raise CommandError("Please specifie option config")

        if options["filename"] is None:
            raise CommandError("Filename not found")

        try:
            if options["grillename"]:
                ie_Grille().import_grillename(
                    reseller=self.reseller,
                    ga=self.ga,
                    config=self.infoconfig,
                    filename=options["filename"],
                    force=options["force"],
                )

            if options["grilleprice"]:
                ie_Grille().import_grilleprice(
                    reseller=self.reseller, config=self.infoconfig, filename=options["filename"], force=options["force"]
                )

            if options["grilleclient"]:
                ie_Grille().import_grilleclient(
                    reseller=self.reseller, config=self.infoconfig, filename=options["filename"], force=options["force"]
                )

        except Exception, e:
            raise CommandError("%s" % e)