Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph-volume: Nits noticed while studying code #21455

Merged
merged 3 commits into from Apr 21, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ceph-volume/ceph_volume/api/lvm.py
Expand Up @@ -76,7 +76,7 @@ def get_api_vgs():
Return the list of group volumes available in the system using flags to
include common metadata associated with them

Command and sample delimeted output, should look like::
Command and sample delimited output should look like::

$ vgs --noheadings --separator=';' \
-o vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free
Expand All @@ -96,7 +96,7 @@ def get_api_lvs():
Return the list of logical volumes available in the system using flags to include common
metadata associated with them

Command and delimeted output, should look like::
Command and delimited output should look like::

$ lvs --noheadings --separator=';' -o lv_tags,lv_path,lv_name,vg_name
;/dev/ubuntubox-vg/root;root;ubuntubox-vg
Expand All @@ -117,7 +117,7 @@ def get_api_pvs():

This will only return physical volumes set up to work with LVM.

Command and delimeted output, should look like::
Command and delimited output should look like::

$ pvs --noheadings --separator=';' -o pv_name,pv_tags,pv_uuid
/dev/sda1;;
Expand Down Expand Up @@ -217,7 +217,7 @@ def remove_vg(vg_name):
"""
Removes a volume group.
"""
fail_msg = "Unable to remove vg %s".format(vg_name)
fail_msg = "Unable to remove vg %s" % vg_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woah, great catch! thanks for fixing these

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, thank VS Code

process.run(
[
'vgremove',
Expand All @@ -233,7 +233,7 @@ def remove_pv(pv_name):
"""
Removes a physical volume.
"""
fail_msg = "Unable to remove vg %s".format(pv_name)
fail_msg = "Unable to remove vg %s" % pv_name
process.run(
[
'pvremove',
Expand Down Expand Up @@ -263,7 +263,7 @@ def remove_lv(path):
terminal_verbose=True,
)
if returncode != 0:
raise RuntimeError("Unable to remove %s".format(path))
raise RuntimeError("Unable to remove %s" % path)
return True


Expand Down Expand Up @@ -446,7 +446,7 @@ def _populate(self):

def _purge(self):
"""
Deplete all the items in the list, used internally only so that we can
Delete all the items in the list, used internally only so that we can
dynamically allocate the items when filtering without the concern of
messing up the contents
"""
Expand Down
2 changes: 1 addition & 1 deletion src/ceph-volume/ceph_volume/process.py
Expand Up @@ -61,7 +61,7 @@ def log_descriptors(reads, process, terminal_logging):
def obfuscate(command_, on=None):
"""
Certain commands that are useful to log might contain information that
should be replaced by '*' like when creating OSDs and the keyryings are
should be replaced by '*' like when creating OSDs and the keyrings are
being passed, which should not be logged.

:param on: A string (will match a flag) or an integer (will match an index)
Expand Down
2 changes: 1 addition & 1 deletion src/ceph-volume/ceph_volume/systemd/systemctl.py
Expand Up @@ -60,7 +60,7 @@ def mask_ceph_disk():
# systemctl allows using a glob like '*' for masking, but there was a bug
# in that it wouldn't allow this for service templates. This means that
# masking ceph-disk@* will not work, so we must link the service directly.
# /etc/systemd takes precendence regardless of the location of the unit
# /etc/systemd takes precedence regardless of the location of the unit
process.run(
['ln', '-sf', '/dev/null', '/etc/systemd/system/ceph-disk@.service']
)
Expand Down