Skip to content

Commit 6c709fa

Browse files
committed
More split string fixes
1 parent 4a3c50e commit 6c709fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+261
-297
lines changed

src/modules/actions/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __str__(self):
117117
"unknown action type '{type}' in package "
118118
"'{fmri}' in action '{action}'"
119119
).format(type=self.type, fmri=self.fmri, action=self.actionstr)
120-
return _("unknown action type '{type}' in action " "'{action}'").format(
120+
return _("unknown action type '{type}' in action '{action}'").format(
121121
type=self.type, action=self.actionstr
122122
)
123123

@@ -179,7 +179,7 @@ def __init__(self, *args):
179179
def __str__(self):
180180
if hasattr(self, "fmri") and self.fmri is not None:
181181
return _(
182-
"invalid action in package {fmri}: " "{action}: {error}"
182+
"invalid action in package {fmri}: {action}: {error}"
183183
).format(fmri=self.fmri, action=self.actionstr, error=self.errorstr)
184184
return _("invalid action, '{action}': {error}").format(
185185
action=self.actionstr, error=self.errorstr

src/modules/actions/depend.py

+12-16
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def __check_parent_installed(self, image, pkg_fmri, fmri):
126126
errors = []
127127
if fmri.pkg_name not in ppkgs_dict:
128128
errors.append(
129-
_("Package is not installed in " "parent image {0}").format(
129+
_("Package is not installed in parent image {0}").format(
130130
fmri.pkg_name
131131
)
132132
)
@@ -137,7 +137,7 @@ def __check_parent_installed(self, image, pkg_fmri, fmri):
137137
# package is from a different publisher
138138
errors.append(
139139
_(
140-
"Package in parent is from a " "different publisher: {0}"
140+
"Package in parent is from a different publisher: {0}"
141141
).format(pf)
142142
)
143143
return errors
@@ -156,15 +156,11 @@ def __check_parent_installed(self, image, pkg_fmri, fmri):
156156

157157
if pf.version.is_successor(fmri.version, pkg.version.CONSTRAINT_NONE):
158158
errors.append(
159-
_("Parent image has a newer " "version of package {0}").format(
160-
pf
161-
)
159+
_("Parent image has a newer version of package {0}").format(pf)
162160
)
163161
else:
164162
errors.append(
165-
_("Parent image has an older " "version of package {0}").format(
166-
pf
167-
)
163+
_("Parent image has an older version of package {0}").format(pf)
168164
)
169165

170166
return errors
@@ -183,7 +179,7 @@ def __check_installed(
183179
):
184180
errors.append(
185181
_(
186-
"{dep_type} dependency {dep_val} " "is downrev ({inst_ver})"
182+
"{dep_type} dependency {dep_val} is downrev ({inst_ver})"
187183
).format(
188184
dep_type=ctype, dep_val=min_fmri, inst_ver=installed_version
189185
)
@@ -199,7 +195,7 @@ def __check_installed(
199195
):
200196
errors.append(
201197
_(
202-
"{dep_type} dependency {dep_val} " "is uprev ({inst_ver})"
198+
"{dep_type} dependency {dep_val} is uprev ({inst_ver})"
203199
).format(
204200
dep_type=ctype, dep_val=max_fmri, inst_ver=installed_version
205201
)
@@ -313,7 +309,7 @@ def __min_version():
313309
if group_stems and not matching_stems:
314310
stems = ", ".join(p for p in group_stems)
315311
errors.append(
316-
_("Group dependency on one of {0} not " "met").format(stems)
312+
_("Group dependency on one of {0} not met").format(stems)
317313
)
318314
return errors, warnings, info
319315
elif ctype == "require-any":
@@ -328,7 +324,7 @@ def __min_version():
328324
errors.extend(e)
329325
if not errors: # none was installed
330326
errors.append(
331-
_("Required dependency on one of " "{0} not met").format(
327+
_("Required dependency on one of {0} not met").format(
332328
", ".join((str(p) for p in pfmris))
333329
)
334330
)
@@ -352,7 +348,7 @@ def __min_version():
352348

353349
if required and not installed_version:
354350
errors.append(
355-
_("Required dependency {0} is not " "installed").format(pfmri)
351+
_("Required dependency {0} is not installed").format(pfmri)
356352
)
357353

358354
# cannot verify origin since it applys to upgrade
@@ -571,9 +567,9 @@ def validate(self, fmri=None):
571567
errors.append(
572568
(
573569
attr,
574-
_(
575-
"invalid {attr} value " "'{value}': {error}"
576-
).format(attr=attr, value=f, error=str(e)),
570+
_("invalid {attr} value '{value}': {error}").format(
571+
attr=attr, value=f, error=str(e)
572+
),
577573
)
578574
)
579575

src/modules/actions/driver.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def remove_aliases(driver_name, aliases, image):
149149
args = rem_base + ("-i", "{0}".format(i), driver_name)
150150
DriverAction.__call(
151151
args,
152-
"driver ({name}) upgrade (removal " "of alias '{alias}')",
152+
"driver ({name}) upgrade (removal of alias '{alias}')",
153153
{"name": driver_name, "alias": i},
154154
)
155155

@@ -368,7 +368,7 @@ def install(self, pkgplan, orig):
368368
)
369369
self.__call(
370370
args,
371-
"driver ({name}) clone permission " "update",
371+
"driver ({name}) clone permission update",
372372
{"name": self.attrs["name"]},
373373
)
374374

@@ -433,7 +433,7 @@ def __update_install(self, image, orig):
433433
args = add_base + ("-i", "{0}".format(i), self.attrs["name"])
434434
self.__call(
435435
args,
436-
"driver ({name}) upgrade (addition " "of alias '{alias}')",
436+
"driver ({name}) upgrade (addition of alias '{alias}')",
437437
{"name": self.attrs["name"], "alias": i},
438438
)
439439

@@ -597,31 +597,31 @@ def update_devlinks():
597597
args = rem_base + ("-m", i, self.attrs["name"])
598598
self.__call(
599599
args,
600-
"driver ({name}) upgrade (removal " "of minor perm '{perm}')",
600+
"driver ({name}) upgrade (removal of minor perm '{perm}')",
601601
{"name": self.attrs["name"], "perm": i},
602602
)
603603

604604
for i in add_perms:
605605
args = add_base + ("-m", i, self.attrs["name"])
606606
self.__call(
607607
args,
608-
"driver ({name}) upgrade (addition " "of minor perm '{perm}')",
608+
"driver ({name}) upgrade (addition of minor perm '{perm}')",
609609
{"name": self.attrs["name"], "perm": i},
610610
)
611611

612612
for i in add_privs:
613613
args = add_base + ("-P", i, self.attrs["name"])
614614
self.__call(
615615
args,
616-
"driver ({name}) upgrade (addition " "of privilege '{priv}')",
616+
"driver ({name}) upgrade (addition of privilege '{priv}')",
617617
{"name": self.attrs["name"], "priv": i},
618618
)
619619

620620
for i in rem_privs:
621621
args = rem_base + ("-P", i, self.attrs["name"])
622622
self.__call(
623623
args,
624-
"driver ({name}) upgrade (removal " "of privilege '{priv}')",
624+
"driver ({name}) upgrade (removal of privilege '{priv}')",
625625
{"name": self.attrs["name"], "priv": i},
626626
)
627627

@@ -655,15 +655,15 @@ def update_devlinks():
655655
args = rem_base + ("-p", minornode, self.attrs["name"])
656656
self.__call(
657657
args,
658-
"driver ({name}) upgrade (removal " "of policy '{policy}')",
658+
"driver ({name}) upgrade (removal of policy '{policy}')",
659659
{"name": self.attrs["name"], "policy": i},
660660
)
661661

662662
for i in add_policy:
663663
args = add_base + ("-p", i, self.attrs["name"])
664664
self.__call(
665665
args,
666-
"driver ({name}) upgrade (addition " "of policy '{policy}')",
666+
"driver ({name}) upgrade (addition of policy '{policy}')",
667667
{"name": self.attrs["name"], "policy": i},
668668
)
669669

@@ -932,22 +932,22 @@ def verify(self, img, **args):
932932
mfst_aliases = set(self.attrlist("alias"))
933933
for a in onfs_aliases - mfst_aliases:
934934
warnings.append(
935-
_("extra alias '{0}' found in " "etc/driver_aliases").format(a)
935+
_("extra alias '{0}' found in etc/driver_aliases").format(a)
936936
)
937937
for a in mfst_aliases - onfs_aliases:
938938
errors.append(
939-
_("alias '{0}' missing from " "etc/driver_aliases").format(a)
939+
_("alias '{0}' missing from etc/driver_aliases").format(a)
940940
)
941941

942942
onfs_classes = set(onfs.attrlist("class"))
943943
mfst_classes = set(self.attrlist("class"))
944944
for a in onfs_classes - mfst_classes:
945945
warnings.append(
946-
_("extra class '{0}' found in " "etc/driver_classes").format(a)
946+
_("extra class '{0}' found in etc/driver_classes").format(a)
947947
)
948948
for a in mfst_classes - onfs_classes:
949949
errors.append(
950-
_("class '{0}' missing from " "etc/driver_classes").format(a)
950+
_("class '{0}' missing from etc/driver_classes").format(a)
951951
)
952952

953953
onfs_perms = set(onfs.attrlist("perms"))
@@ -962,7 +962,7 @@ def verify(self, img, **args):
962962
for a in mfst_perms - onfs_perms:
963963
errors.append(
964964
_(
965-
"minor node permission '{0}' missing " "from etc/minor_perm"
965+
"minor node permission '{0}' missing from etc/minor_perm"
966966
).format(a)
967967
)
968968

@@ -1038,7 +1038,7 @@ def remove(self, pkgplan):
10381038
)
10391039
self.__call(
10401040
args,
1041-
"driver ({name}) clone permission " "update",
1041+
"driver ({name}) clone permission update",
10421042
{"name": self.attrs["name"]},
10431043
)
10441044

src/modules/actions/file.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def install(self, pkgplan, orig):
242242
except zlib.error as e:
243243
raise ActionExecutionError(
244244
self,
245-
details=_("Error decompressing payload: " "{0}").format(
245+
details=_("Error decompressing payload: {0}").format(
246246
" ".join([str(a) for a in e.args])
247247
),
248248
error=e,
@@ -398,7 +398,7 @@ def verify(self, img, **args):
398398
!= misc.timestamp_to_time(self.attrs["timestamp"])
399399
):
400400
errors.append(
401-
_("Timestamp: {found} should be " "{expected}").format(
401+
_("Timestamp: {found} should be {expected}").format(
402402
found=misc.time_to_timestamp(lstat.st_mtime),
403403
expected=self.attrs["timestamp"],
404404
)
@@ -416,7 +416,7 @@ def verify(self, img, **args):
416416
and lstat.st_size != pkg_size
417417
):
418418
errors.append(
419-
_("Size: {found:d} bytes should be " "{expected:d}").format(
419+
_("Size: {found:d} bytes should be {expected:d}").format(
420420
found=lstat.st_size, expected=pkg_size
421421
)
422422
)
@@ -484,7 +484,7 @@ def verify(self, img, **args):
484484

485485
if elfhash is not None and elf_hash_val != elfhash[0]:
486486
elferror = _(
487-
"ELF content hash: " "{found} " "should be {expected}"
487+
"ELF content hash: {found} should be {expected}"
488488
).format(found=elfhash[0], expected=elf_hash_val)
489489

490490
# Always check on the file hash because the ELF hash
@@ -496,15 +496,15 @@ def verify(self, img, **args):
496496
if sha_hash != hash_val:
497497
# Prefer the ELF content hash error message.
498498
if preserve is not None:
499-
info.append(_("editable file has " "been changed"))
499+
info.append(_("editable file has been changed"))
500500
elif elferror:
501501
errors.append(elferror)
502502
self.replace_required = True
503503
else:
504504
errors.append(
505-
_(
506-
"Hash: " "{found} should be " "{expected}"
507-
).format(found=sha_hash, expected=hash_val)
505+
_("Hash: {found} should be {expected}").format(
506+
found=sha_hash, expected=hash_val
507+
)
508508
)
509509
self.replace_required = True
510510

@@ -532,7 +532,7 @@ def verify(self, img, **args):
532532
for a in sattrs:
533533
if a not in set_attrs:
534534
errors.append(
535-
_("System attribute '{0}' " "not set").format(a)
535+
_("System attribute '{0}' not set").format(a)
536536
)
537537

538538
except EnvironmentError as e:
@@ -1001,28 +1001,28 @@ def validate(self, fmri=None):
10011001
errors.append(
10021002
(
10031003
"preserve-version",
1004-
_("preserve-version must specify " "the release"),
1004+
_("preserve-version must specify the release"),
10051005
)
10061006
)
10071007
if build_release != "":
10081008
errors.append(
10091009
(
10101010
"preserve-version",
1011-
_("preserve-version must specify " "the release"),
1011+
_("preserve-version must specify the release"),
10121012
)
10131013
)
10141014
if branch:
10151015
errors.append(
10161016
(
10171017
"preserve-version",
1018-
_("preserve-version must not specify " "the branch"),
1018+
_("preserve-version must not specify the branch"),
10191019
)
10201020
)
10211021
if timestr:
10221022
errors.append(
10231023
(
10241024
"preserve-version",
1025-
_("preserve-version must not specify " "the timestamp"),
1025+
_("preserve-version must not specify the timestamp"),
10261026
)
10271027
)
10281028

src/modules/actions/generic.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def _validate_fsobj_common(self):
842842
)
843843
)
844844
elif isinstance(raw_mode, list):
845-
errors.append(("mode", _("mode may only be " "specified once")))
845+
errors.append(("mode", _("mode may only be specified once")))
846846
else:
847847
errors.append(
848848
(
@@ -858,12 +858,12 @@ def _validate_fsobj_common(self):
858858
try:
859859
owner = self.attrs.get("owner", "").rstrip()
860860
except AttributeError:
861-
errors.append(("owner", _("owner may only be specified " "once")))
861+
errors.append(("owner", _("owner may only be specified once")))
862862

863863
try:
864864
group = self.attrs.get("group", "").rstrip()
865865
except AttributeError:
866-
errors.append(("group", _("group may only be specified " "once")))
866+
errors.append(("group", _("group may only be specified once")))
867867

868868
return errors
869869

@@ -1064,7 +1064,7 @@ def ftype_to_name(ftype):
10641064

10651065
if ftype is not None and ftype != stat.S_IFMT(lstat.st_mode):
10661066
errors.append(
1067-
_("file type: '{found}' should be " "'{expected}'").format(
1067+
_("file type: '{found}' should be '{expected}'").format(
10681068
found=ftype_to_name(stat.S_IFMT(lstat.st_mode)),
10691069
expected=ftype_to_name(ftype),
10701070
)
@@ -1101,7 +1101,7 @@ def ftype_to_name(ftype):
11011101

11021102
if mode is not None and stat.S_IMODE(lstat.st_mode) != mode:
11031103
errors.append(
1104-
_("mode: {found:04o} should be " "{expected:04o}").format(
1104+
_("mode: {found:04o} should be {expected:04o}").format(
11051105
found=stat.S_IMODE(lstat.st_mode), expected=mode
11061106
)
11071107
)
@@ -1276,14 +1276,14 @@ def _validate(
12761276
or attr in single_attrs
12771277
) and type(self.attrs[attr]) is list:
12781278
errors.append(
1279-
(attr, _("{0} may only be " "specified once").format(attr))
1279+
(attr, _("{0} may only be specified once").format(attr))
12801280
)
12811281
elif attr in numeric_attrs:
12821282
try:
12831283
int(self.attrs[attr])
12841284
except (TypeError, ValueError):
12851285
errors.append(
1286-
(attr, _("{0} must be an " "integer").format(attr))
1286+
(attr, _("{0} must be an integer").format(attr))
12871287
)
12881288

12891289
for attr in required_attrs:

0 commit comments

Comments
 (0)