@defer.inlineCallbacks
    def perspective_load(self, profile='jcli-prod'):
        path = '%s/%s.smppccs' % (self.config.store_path, profile)
        self.log.info('Loading/Activating [%s] profile configuration from %s', profile, path)

        try:
            # Load configuration from file
            fh = open(path, 'r')
            lines = fh.readlines()
            fh.close()

            # Init migrator
            cf = ConfigurationMigrator(context='smppccs', header=lines[0], data=''.join(lines[1:]))

            # Remove current configuration
            CIDs = []
            for c in self.connectors:
                CIDs.append(c['id'])
            for cid in CIDs:
                remRet = yield self.perspective_connector_remove(cid)
                if not remRet:
                    raise ConfigProfileLoadingError('Error removing connector %s' % cid)
                self.log.info('Removed connector [%s]', cid)

            # Apply configuration
            loadedConnectors = cf.getMigratedData()
            for loadedConnector in loadedConnectors:
                # Add connector
                addRet = yield self.perspective_connector_add(
                    pickle.dumps(loadedConnector['config'],
                                 self.pickleProtocol))
                if not addRet:
                    raise ConfigProfileLoadingError('Error adding connector %s' % loadedConnector['id'])

                # Start it if it's service where started when persisted
                if loadedConnector['service_status'] == 1:
                    startRet = yield self.perspective_connector_start(loadedConnector['id'])
                    if not startRet:
                        self.log.error('Error starting connector %s', loadedConnector['id'])

            # Set persistance state to True
            self.persisted = True
        except __HOLE__, e:
            self.log.error('Cannot load configuration from %s: %s', path, str(e))
            defer.returnValue(False)
        except ConfigProfileLoadingError, e:
            self.log.error('Error while loading configuration: %s', e)
            defer.returnValue(False)
        except Exception, e:
            self.log.error('Unknown error occurred while loading configuration: %s', e)
            defer.returnValue(False)

        defer.returnValue(True)
dataset/ETHPy150Open jookies/jasmin/jasmin/managers/clients.py/SMPPClientManagerPB.perspective_load