diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-06-30 15:59:01 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-06-30 15:59:01 +0000 |
commit | e32bbfbca5233d4ad7a5bee74698d614ff0b1f24 (patch) | |
tree | 5f6b08da35732532f2b3d8761bd7f26a61ce8aab /src/lib/Server/Plugin.py | |
parent | 477603f8f0680f40781559ec1cee8f85c2d76913 (diff) | |
download | bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.tar.gz bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.tar.bz2 bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.zip |
Unicode support (from stousignant) (Resolves Ticket #549)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4731 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r-- | src/lib/Server/Plugin.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 6b308d1f7..61e7021c6 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -444,7 +444,7 @@ class Specificity: return False class SpecificData(object): - def __init__(self, name, _, specific): + def __init__(self, name, _, specific, encoding): self.name = name self.specific = specific @@ -459,13 +459,14 @@ class SpecificData(object): class EntrySet: '''Entry sets deal with the host- and group-specific entries''' ignore = re.compile("^(.*~|\\..*\\.(tmp|sw[px]))$") - def __init__(self, basename, path, props, entry_type): + def __init__(self, basename, path, props, entry_type, encoding): self.path = path self.entry_type = entry_type self.entries = {} self.properties = props self.metadata = default_file_metadata.copy() self.infoxml = None + self.encoding = encoding pattern = '(.*/)?%s(\.((H_(?P<hostname>\S+))|' % basename pattern += '(G(?P<prio>\d+)_(?P<group>\S+))))?$' self.specific = re.compile(pattern) @@ -509,7 +510,7 @@ class EntrySet: return self.entries[event.filename] = self.entry_type(fpath, self.properties, - spec) + spec, self.encoding) self.entries[event.filename].handle_event(event) def specificity_from_filename(self, fname): @@ -631,6 +632,7 @@ class GroupSpool(GeneratorPlugin): self.entries = {} self.handles = {} self.AddDirectoryMonitor('') + self.encoding = core.encoding if self.use_props: try: self.properties = TemplateProperties( \ @@ -661,7 +663,8 @@ class GroupSpool(GeneratorPlugin): self.entries[ident] = self.es_cls(self.filename_pattern, dirpath, self.properties, - self.es_child_cls) + self.es_child_cls, + self.encoding) self.Entries['ConfigFile'][ident] = self.entries[ident].bind_entry if not posixpath.isdir(epath): # do not pass through directory events |