(self)
what actions are needed?
what actions are needed?
what actions are needed?
def plan(self):
        """ what actions are needed? """

        if self.recursive:
            raise ProviderError(self, "recursive is not implemented yet")
        if FileTests.is_file(self.name):
            raise ProviderError(self, f"destination path ({self.name}) is a file, uncertain how to proceed")

        exists = FileTests.exists(self.name)

        if self.absent:
            # removal actions?
            if not exists:
                return
            elif FileTests.is_directory(self.name):
                self.needs('rmdir')
        else:
            # creation?
            if not exists:
                self.needs('mkdir')

            # metadata?
            if self.owner and (self.recursive or not exists or (FileTests.owner(self.name) != self.owner)):
                self.needs('chown')
            elif self.group and (self.recursive or not exists or (FileTests.group(self.name) != self.group)):
                self.needs('chgrp')
            elif self.mode and (self.recursive or not exists or (FileTests.mode(self.name) != self.mode)):
                 self.needs('chmod')
def plan ( self ) : if self . recursive : raise ProviderError ( self , "recursive is not implemented yet" ) if FileTests . is_file ( self . name ) : raise ProviderError ( self , f"destination path ({self.name}) is a file, uncertain how to proceed" ) exists = FileTests . exists ( self . name ) if self . absent : # removal actions? if not exists : return elif FileTests . is_directory ( self . name ) : self . needs ( 'rmdir' ) else : # creation? if not exists : self . needs ( 'mkdir' ) # metadata? if self . owner and ( self . recursive or not exists or ( FileTests . owner ( self . name ) != self . owner ) ) : self . needs ( 'chown' ) elif self . group and ( self . recursive or not exists or ( FileTests . group ( self . name ) != self . group ) ) : self . needs ( 'chgrp' ) elif self . mode and ( self . recursive or not exists or ( FileTests . mode ( self . name ) != self . mode ) ) : self . needs ( 'chmod' )