file.py 491 B

123456789101112131415161718192021222324
  1. from setux.core.action import Action
  2. class Directory(Action):
  3. '''Ensure Directory'''
  4. @property
  5. def label(self):
  6. return f'dir {self.path}'
  7. def check(self):
  8. directory = self.target.dir.fetch(
  9. self.path,
  10. **self.spec,
  11. )
  12. return directory.check() is True
  13. def deploy(self):
  14. directory = self.target.dir.fetch(
  15. self.path,
  16. **self.spec,
  17. )
  18. return directory.deploy() is True