~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/virt/disk/vfs/api.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright 2012 Red Hat, Inc.
 
4
#
 
5
# Licensed under the Apache License, Version 2.0 (the "License"); you may
 
6
# not use this file except in compliance with the License. You may obtain
 
7
# a copy of the License at
 
8
#
 
9
# http://www.apache.org/licenses/LICENSE-2.0
 
10
#
 
11
# Unless required by applicable law or agreed to in writing, software
 
12
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
13
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
14
# License for the specific language governing permissions and limitations
 
15
# under the License.
 
16
 
 
17
from nova.openstack.common import log as logging
 
18
 
 
19
LOG = logging.getLogger(__name__)
 
20
 
 
21
 
 
22
class VFS(object):
 
23
 
 
24
    """
 
25
    The VFS class defines an interface for manipulating files within
 
26
    a virtual disk image filesystem. This allows file injection code
 
27
    to avoid the assumption that the virtual disk image can be mounted
 
28
    in the host filesystem.
 
29
 
 
30
    All paths provided to the APIs in this class should be relative
 
31
    to the root of the virtual disk image filesystem. Subclasses
 
32
    will translate paths as required by their implementation.
 
33
    """
 
34
    def __init__(self, imgfile, imgfmt, partition):
 
35
        self.imgfile = imgfile
 
36
        self.imgfmt = imgfmt
 
37
        self.partition = partition
 
38
 
 
39
    """
 
40
    Perform any one-time setup tasks to make the virtual
 
41
    filesystem available to future API calls
 
42
    """
 
43
    def setup(self):
 
44
        pass
 
45
 
 
46
    """
 
47
    Release all resources initialized in the setup method
 
48
    """
 
49
    def teardown(self):
 
50
        pass
 
51
 
 
52
    """
 
53
    Create a directory @path, including all intermedia
 
54
    path components if they do not already exist
 
55
    """
 
56
    def make_path(self, path):
 
57
        pass
 
58
 
 
59
    """
 
60
    Append @content to the end of the file identified
 
61
    by @path, creating the file if it does not already
 
62
    exist
 
63
    """
 
64
    def append_file(self, path, content):
 
65
        pass
 
66
 
 
67
    """
 
68
    Replace the entire contents of the file identified
 
69
    by @path, wth @content, creating the file if it does
 
70
    not already exist
 
71
    """
 
72
    def replace_file(self, path, content):
 
73
        pass
 
74
 
 
75
    """
 
76
    Return the entire contents of the file identified
 
77
    by @path
 
78
    """
 
79
    def read_file(self, path):
 
80
        pass
 
81
 
 
82
    """
 
83
    Return a True if the file identified by @path
 
84
    exists
 
85
    """
 
86
    def has_file(self, path):
 
87
        pass
 
88
 
 
89
    """
 
90
    Set the permissions on the file identified by
 
91
    @path to @mode. The file must exist prior to
 
92
    this call.
 
93
    """
 
94
    def set_permissions(self, path, mode):
 
95
        pass
 
96
 
 
97
    """
 
98
    Set the ownership on the file identified by
 
99
    @path to the username @user and groupname @group.
 
100
    Either of @user or @group may be None, in which case
 
101
    the current ownership will be left unchanged. The
 
102
    ownership must be passed in string form, allowing
 
103
    subclasses to translate to uid/gid form as required.
 
104
    The file must exist prior to this call.
 
105
    """
 
106
    def set_ownership(self, path, user, group):
 
107
        pass