PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/boto-2.5.2/boto/emr/bootstrap_action.py

#
Python | 44 lines | 16 code | 7 blank | 21 comment | 2 complexity | cd0a56b1a0559cea99e6615f602d22cc MD5 | raw file
  1. # Copyright (c) 2010 Spotify AB
  2. # Copyright (c) 2010 Yelp
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining a
  5. # copy of this software and associated documentation files (the
  6. # "Software"), to deal in the Software without restriction, including
  7. # without limitation the rights to use, copy, modify, merge, publish, dis-
  8. # tribute, sublicense, and/or sell copies of the Software, and to permit
  9. # persons to whom the Software is furnished to do so, subject to the fol-
  10. # lowing conditions:
  11. #
  12. # The above copyright notice and this permission notice shall be included
  13. # in all copies or substantial portions of the Software.
  14. #
  15. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16. # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
  17. # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
  18. # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  19. # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. # IN THE SOFTWARE.
  22. class BootstrapAction(object):
  23. def __init__(self, name, path, bootstrap_action_args):
  24. self.name = name
  25. self.path = path
  26. if isinstance(bootstrap_action_args, basestring):
  27. bootstrap_action_args = [bootstrap_action_args]
  28. self.bootstrap_action_args = bootstrap_action_args
  29. def args(self):
  30. args = []
  31. if self.bootstrap_action_args:
  32. args.extend(self.bootstrap_action_args)
  33. return args
  34. def __repr__(self):
  35. return '%s.%s(name=%r, path=%r, bootstrap_action_args=%r)' % (
  36. self.__class__.__module__, self.__class__.__name__,
  37. self.name, self.path, self.bootstrap_action_args)