#NEWLINE# def _created( self , result , new_volume ) : #NEWLINE# #INDENT# "\n        Common post-processing for attempts at creating new volumes from other\n        volumes.\n\n        In particular this includes error handling and ensuring read-only\n        and mountpoint properties are set correctly.\n\n        :param Deferred result: The result of the creation attempt.\n\n        :param Volume new_volume: Volume we're trying to create.\n        " #NEWLINE# new_filesystem = self . get ( new_volume ) #NEWLINE# new_mount_path = new_filesystem . get_path ( ) . path #NEWLINE# def creation_failed( f ) : #NEWLINE# #INDENT# if f . check ( CommandFailed ) : #NEWLINE# #INDENT# raise FilesystemAlreadyExists ( ) #NEWLINE# #UNINDENT# return f #NEWLINE# #UNINDENT# result . addErrback ( creation_failed ) #NEWLINE# def exists( ignored ) : #NEWLINE# #INDENT# if new_volume . locally_owned ( ) : #NEWLINE# #INDENT# result = zfs_command ( self . _reactor , [ b'set' , b'readonly=off' , new_filesystem . name ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = zfs_command ( self . _reactor , [ b'inherit' , b'readonly' , new_filesystem . name ] ) #NEWLINE# #UNINDENT# result . addCallback ( ( lambda _ : zfs_command ( self . _reactor , [ b'set' , ( b'mountpoint=' + new_mount_path ) , new_filesystem . name ] ) ) ) #NEWLINE# return result #NEWLINE# #UNINDENT# result . addCallback ( exists )