Source code for lago.paths

#
# Copyright 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
#
# Refer to the README and COPYING files for full details of the license
#
import os


[docs]class Paths(object): def __init__(self, prefix): self.prefix = prefix
[docs] def prefixed(self, *args): return os.path.join(self.prefix, *args)
[docs] def uuid(self): return self.prefixed('uuid')
[docs] def ssh_id_rsa(self): return self.prefixed('id_rsa')
[docs] def ssh_id_rsa_pub(self): return self.prefixed('id_rsa.pub')
[docs] def images(self, *path): return self.prefixed('images', *path)
[docs] def virt(self, *path): return self.prefixed('virt', *path)
[docs] def logs(self): return self.prefixed('logs')
[docs] def metadata(self): return self.prefixed('metadata')
[docs] def prefix_lagofile(self): "This file represents a prefix that's initialized" return self.prefixed('initialized')
[docs] def scripts(self, *args): return self.prefixed('scripts', *args)