def resolveNames(self): """ Resolve any names given in the parameters. This methods is called after all objects have been initialized. """ client.resolveNames(self)
def resolveNames(self): """ Resolve any names given in the parameters. This methods is called after all objects have been initialized. """ client.resolveNames(self) for f in self.changeTrackers: if f not in self.scenario.getObjectsDict( 'file' ): raise Exception( "Client {0} was instructed to change the torrent file of file {1}, but the latter was never declared.".format( self.name, f ) ) if not self.scenario.getObjectsDict( 'file' )[f].metaFile or not os.path.exists( self.scenario.getObjectsDict( 'file' )[f].metaFile ) or os.path.isdir( self.scenario.getObjectsDict( 'file' )[f].metaFile ): raise Exception( "Client {0} was instructed to change the torrent file of file {1}, but the metafile of the latter does not exist or is a directory.".format( self.name, f ) ) for c in self.changeClientTrackers: if c not in self.scenario.getObjectsDict( 'client' ): raise Exception( "Client {0} was instructed to change the torrent files in client {1}, but the latter was never declared.".format( self.name, c ) )