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


        exists = FileTests.exists(self.name)

        if FileTests.is_directory(self.name):
            raise ProviderError(self, f"Is a directory: {self.name}")

        # removal?
        if self.absent:
            if exists:
                self.needs("rm")
            return

        # content?
        if (self.from_content or self.from_template or self.from_file or self.from_url):
            if self.from_template:
                if self.should_replace_using_template():
                    self.needs('copy_template')
            elif self.from_file:
                if self.should_replace_using_file():
                    self.needs('copy_file')
            elif self.from_url:
                if self.should_replace_using_url():
                    self.needs('copy_url')
            elif self.from_content:
                if self.should_replace_using_content():
                    self.needs('copy_content')

        # metadata?
        if self.owner and (not exists or not (FileTests.owner(self.name) == self.owner)):
            self.needs('chown')
        if self.group and (not exists or not (FileTests.group(self.name) == self.group)):
            self.needs('chgrp')
        if self.mode and (not exists or not (FileTests.mode(self.name) == self.mode)):
            self.needs('chmod')
def plan ( self ) : exists = FileTests . exists ( self . name ) if FileTests . is_directory ( self . name ) : raise ProviderError ( self , f"Is a directory: {self.name}" ) # removal? if self . absent : if exists : self . needs ( "rm" ) return # content? if ( self . from_content or self . from_template or self . from_file or self . from_url ) : if self . from_template : if self . should_replace_using_template ( ) : self . needs ( 'copy_template' ) elif self . from_file : if self . should_replace_using_file ( ) : self . needs ( 'copy_file' ) elif self . from_url : if self . should_replace_using_url ( ) : self . needs ( 'copy_url' ) elif self . from_content : if self . should_replace_using_content ( ) : self . needs ( 'copy_content' ) # metadata? if self . owner and ( not exists or not ( FileTests . owner ( self . name ) == self . owner ) ) : self . needs ( 'chown' ) if self . group and ( not exists or not ( FileTests . group ( self . name ) == self . group ) ) : self . needs ( 'chgrp' ) if self . mode and ( not exists or not ( FileTests . mode ( self . name ) == self . mode ) ) : self . needs ( 'chmod' )