mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmdbusd: Fix grammar
This commit is contained in:
parent
a861f0425e
commit
5561281f0a
@ -44,10 +44,10 @@ class AutomatedProperties(dbus.service.Object):
|
||||
|
||||
def set_interface(self, interface):
|
||||
"""
|
||||
With inheritance we can't easily tell what interfaces a class provides
|
||||
With inheritance, we can't easily tell what interfaces a class provides,
|
||||
so we will have each class that implements an interface tell the
|
||||
base AutomatedProperties what it is they do provide. This is kind of
|
||||
clunky and perhaps we can figure out a better way to do this later.
|
||||
clunky, and perhaps we can figure out a better way to do this later.
|
||||
:param interface: An interface the object supports
|
||||
:return:
|
||||
"""
|
||||
|
@ -62,7 +62,7 @@ def _move_callback(job_state, line_str):
|
||||
def _move_merge(interface_name, command, job_state):
|
||||
# We need to execute these command stand alone by forking & exec'ing
|
||||
# the command always as we will be getting periodic output from them on
|
||||
# the status of the long running operation.
|
||||
# the status of the long-running operation.
|
||||
|
||||
meta = LvmExecutionMeta(time.time(), 0, command)
|
||||
cfg.flightrecorder.add(meta)
|
||||
|
@ -27,13 +27,13 @@ bus = None
|
||||
# Command line args
|
||||
args = None
|
||||
|
||||
# Set to true if we are depending on external events for updates
|
||||
# Set to true if we depend on external events for updates
|
||||
got_external_event = False
|
||||
|
||||
# Shared state variable across all processes
|
||||
run = multiprocessing.Value('i', 1)
|
||||
|
||||
# If this is set to true, the current setup support lvm shell and we are
|
||||
# If this is set to true, the current setup support lvm shell, and we are
|
||||
# running in that mode of operation
|
||||
SHELL_IN_USE = None
|
||||
|
||||
|
@ -109,7 +109,7 @@ def call_lvm(command, debug=False, line_cb=None,
|
||||
stdin, CALL MUST EXECUTE QUICKLY and not *block*
|
||||
otherwise call_lvm function will fail to read
|
||||
stdin/stdout. Return value of call back is ignored
|
||||
:param cb_data: Supplied to callback to allow caller access to
|
||||
:param cb_data: Supplied to call back to allow caller access to
|
||||
its own data
|
||||
|
||||
# Callback signature
|
||||
@ -213,7 +213,7 @@ def _shell_cfg():
|
||||
def set_execution(shell):
|
||||
global _t_call
|
||||
with cmd_lock:
|
||||
# If the user requested lvm shell and we are currently setup that
|
||||
# If the user requested lvm shell, and we are currently setup that
|
||||
# way, just return
|
||||
if cfg.SHELL_IN_USE and shell:
|
||||
return True
|
||||
|
@ -44,7 +44,7 @@ class WaitingClient(object):
|
||||
self.timer_id = GLib.timeout_add_seconds(
|
||||
tmo, WaitingClient._timeout, self)
|
||||
|
||||
# The job finished before the timer popped and we are being notified that
|
||||
# The job finished before the timer popped, and we are being notified that
|
||||
# it's done
|
||||
def notify(self):
|
||||
with self.rlock:
|
||||
@ -71,7 +71,7 @@ class JobState(object):
|
||||
self._stderr = ''
|
||||
self._waiting_clients = []
|
||||
|
||||
# This is an lvm command that is just taking too long and doesn't
|
||||
# This is a lvm command that is just taking too long and doesn't
|
||||
# support background operation
|
||||
if self._request:
|
||||
# Faking the percentage when we don't have one
|
||||
@ -138,7 +138,7 @@ class JobState(object):
|
||||
# If a waiting client timer pops before the job is done we will allow
|
||||
# the client to remove themselves from the list. As we have a lock
|
||||
# here and a lock in the waiting client too, and they can be obtained
|
||||
# in different orders, a dead lock can occur.
|
||||
# in different orders, a deadlock can occur.
|
||||
# As this remove is really optional, we will try to acquire the lock
|
||||
# and remove. If we are unsuccessful it's not fatal, we just delay
|
||||
# the time when the objects can be garbage collected by python
|
||||
|
@ -42,7 +42,7 @@ def common(retrieve, o_type, search_keys,
|
||||
existing_paths = cfg.om.object_paths_by_type(o_type)
|
||||
|
||||
for o in objects:
|
||||
# Assume we need to add this one to dbus, unless we are refreshing
|
||||
# Assume we need to add this one to dbus, unless we are refreshing,
|
||||
# and it's already present
|
||||
return_object = True
|
||||
|
||||
|
@ -25,8 +25,8 @@ from .utils import round_size, mt_remove_dbus_objects, lvm_column_key
|
||||
from .job import JobState
|
||||
|
||||
|
||||
# Try and build a key for a LV, so that we sort the LVs with least dependencies
|
||||
# first. This may be error prone because of the flexibility LVM
|
||||
# Try and build a key for a LV, so that we sort the LVs with the least dependencies
|
||||
# first. This may be error-prone because of the flexibility LVM
|
||||
# provides and what you can stack.
|
||||
def get_key(i):
|
||||
|
||||
|
@ -67,7 +67,7 @@ def check_fr_size(value):
|
||||
|
||||
def install_signal_handlers():
|
||||
# Because of the glib main loop stuff the python signal handler code is
|
||||
# apparently not usable and we need to use the glib calls instead
|
||||
# apparently not usable, and we need to use the glib calls instead
|
||||
signal_add = None
|
||||
|
||||
if hasattr(GLib, 'unix_signal_add'):
|
||||
@ -208,7 +208,7 @@ def main():
|
||||
thread_list.append(
|
||||
threading.Thread(target=process_request, name='process_request'))
|
||||
|
||||
# Have a single thread handling updating lvm and the dbus model so we
|
||||
# Have a single thread handling updating lvm and the dbus model, so we
|
||||
# don't have multiple threads doing this as the same time
|
||||
updater = StateUpdate()
|
||||
thread_list.append(updater.thread)
|
||||
|
@ -159,7 +159,7 @@ class ObjectManager(AutomatedProperties):
|
||||
# print('Registering object path %s for %s' %
|
||||
# (path, dbus_object.lvm_id))
|
||||
|
||||
# We want fast access to the object by a number of different ways
|
||||
# We want fast access to the object by a number of different ways,
|
||||
# so we use multiple hashs with different keys
|
||||
self._lookup_add(dbus_object, path, dbus_object.lvm_id,
|
||||
dbus_object.Uuid)
|
||||
@ -209,7 +209,7 @@ class ObjectManager(AutomatedProperties):
|
||||
|
||||
def get_object_by_lvm_id(self, lvm_id):
|
||||
"""
|
||||
Given an lvm identifier, return the object registered for it
|
||||
Given a lvm identifier, return the object registered for it
|
||||
:param lvm_id: The lvm identifier
|
||||
"""
|
||||
with self.rlock:
|
||||
@ -220,7 +220,7 @@ class ObjectManager(AutomatedProperties):
|
||||
|
||||
def get_object_path_by_lvm_id(self, lvm_id):
|
||||
"""
|
||||
Given an lvm identifier, return the object path for it
|
||||
Given a lvm identifier, return the object path for it
|
||||
:param lvm_id: The lvm identifier
|
||||
:return: Object path or '/' if not found
|
||||
"""
|
||||
@ -295,7 +295,7 @@ class ObjectManager(AutomatedProperties):
|
||||
if uuid == lvm_id:
|
||||
path = self._id_lookup(lvm_id)
|
||||
else:
|
||||
# We have a uuid and a lvm_id we can do sanity checks to ensure
|
||||
# We have an uuid and a lvm_id we can do sanity checks to ensure
|
||||
# that they are consistent
|
||||
|
||||
# If a PV is missing its device path is '[unknown]' or some
|
||||
@ -305,7 +305,7 @@ class ObjectManager(AutomatedProperties):
|
||||
if cfg.db.pv_missing(uuid):
|
||||
lvm_id = None
|
||||
|
||||
# Lets check for the uuid first
|
||||
# Let's check for the uuid first
|
||||
path = self._id_lookup(uuid)
|
||||
if path:
|
||||
# Ensure table lookups are correct
|
||||
|
@ -141,7 +141,7 @@ class RequestEntry(object):
|
||||
|
||||
mt_async_call(self.cb_error, error_exception)
|
||||
else:
|
||||
# We have a job and it's complete, indicate that it's done.
|
||||
# We have a job, and it's complete, indicate that it's done.
|
||||
self._job.Complete = True
|
||||
self._job = None
|
||||
|
||||
|
@ -90,7 +90,7 @@ def init_class_from_arguments(
|
||||
nt = k
|
||||
|
||||
# If the current attribute has a value, but the incoming does
|
||||
# not, don't overwrite it. Otherwise the default values on the
|
||||
# not, don't overwrite it. Otherwise, the default values on the
|
||||
# property decorator don't work as expected.
|
||||
cur = getattr(obj_instance, nt, v)
|
||||
|
||||
@ -110,7 +110,7 @@ def init_class_from_arguments(
|
||||
|
||||
def get_properties(f):
|
||||
"""
|
||||
Walks through an object instance or it's parent class(es) and determines
|
||||
Walks through an object instance, or it's parent class(es) and determines
|
||||
which attributes are properties and if they were created to be used for
|
||||
dbus.
|
||||
:param f: Object to inspect
|
||||
@ -194,7 +194,7 @@ def add_properties(xml, interface, props):
|
||||
interface_element = c
|
||||
break
|
||||
|
||||
# Interface is not present, lets create it so we have something to
|
||||
# Interface is not present, lets create it, so we have something to
|
||||
# attach the properties too
|
||||
if interface_element is None:
|
||||
interface_element = Et.Element("interface", name=interface)
|
||||
|
Loading…
Reference in New Issue
Block a user