diff options
author | Joshua Harlow <harlowja@gmail.com> | 2013-07-23 12:05:04 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-07-23 12:05:04 -0400 |
commit | 838d6c7ddcac8544afb99cb78e8d044fd63b835f (patch) | |
tree | c44bde5e0e7a64a70d1981c38d468311435fafd5 /cloudinit/handlers/shell_script.py | |
parent | a8d2b2f8d7b9315d729873b15ed8dedb9c1b069f (diff) | |
parent | 27f096a1ab2e60222f85d87c961e388fdefaf92c (diff) | |
download | vyos-cloud-init-838d6c7ddcac8544afb99cb78e8d044fd63b835f.tar.gz vyos-cloud-init-838d6c7ddcac8544afb99cb78e8d044fd63b835f.zip |
use constants for startswith in handlers. add strip_prefix_suffix.
Just cleans up some repeated strings into module constants + a util function to
do the boothook prefix cleanup (before writing).
Diffstat (limited to 'cloudinit/handlers/shell_script.py')
-rw-r--r-- | cloudinit/handlers/shell_script.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/handlers/shell_script.py b/cloudinit/handlers/shell_script.py index b185c374..62289d98 100644 --- a/cloudinit/handlers/shell_script.py +++ b/cloudinit/handlers/shell_script.py @@ -29,6 +29,7 @@ from cloudinit import util from cloudinit.settings import (PER_ALWAYS) LOG = logging.getLogger(__name__) +SHELL_PREFIX = "#!" class ShellScriptPartHandler(handlers.Handler): @@ -38,7 +39,7 @@ class ShellScriptPartHandler(handlers.Handler): def list_types(self): return [ - handlers.type_from_starts_with("#!"), + handlers.type_from_starts_with(SHELL_PREFIX), ] def handle_part(self, _data, ctype, filename, # pylint: disable=W0221 |