def export_as_troposphere(self):
    out = {}
    for name in ('packages', 'files', 'commands', 'services', 'sources', 'groups', 'users'):
        obj = getattr(self, name, None)
        if obj:
            out[name] = obj.export_as_troposphere()
    return out
def export_as_troposphere(self):
    out = {}
    for name in ('packages', 'files', 'commands', 'services', 'sources', 'groups', 'users'):
        obj = getattr(self, name, None)
        if obj:
            out[name] = obj.export_as_troposphere()
    return out