Skip to content

Commit 18ffb29

Browse files
creid-aristaabio-arista
authored andcommitted
camelCase implemented
1 parent 14ffea9 commit 18ffb29

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/switools/create.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,15 @@ def create( outputSwix=None, rpms=None, manifestYaml=None, force=False ):
183183

184184
@app.command(name="create")
185185
def _create(
186-
output_swix: Annotated[Path, typer.Argument(help="Name of output file.", callback=_parent_path_exists_callback)],
186+
outputSwix: Annotated[Path, typer.Argument(help="Name of output file.", callback=_parent_path_exists_callback)],
187187
rpms: Annotated[List[Path], typer.Argument(help="An RPM to add to the SWIX.", callback=_path_exists_callback)],
188-
manifest_yaml: Annotated[Optional[Path], typer.Option("--info", "-i", help=f"Location of {MANIFEST_YAML} file to add metadata to SWIX.", callback=_path_exists_callback)] = None,
188+
manifestYaml: Annotated[Optional[Path], typer.Option("--info", "-i", help=f"Location of {MANIFEST_YAML} file to add metadata to SWIX.", callback=_path_exists_callback)] = None,
189189
force: Annotated[Optional[bool], typer.Option("--force", "-f", help="Overwrite OUTFILE.swix if it already exists.")] = False,
190190
):
191191
"""
192192
swix create
193193
"""
194-
create(output_swix, rpms, manifest_yaml, force)
194+
create(outputSwix, rpms, manifestYaml, force)
195195

196196
if __name__ == "__main__":
197197
app()

src/switools/signature.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def signSwi( swi, signingCertFile, rootCaFile, signatureFile=None, signingKeyFil
332332

333333
@app.command(name="prepare")
334334
def _prepare(
335-
swi_file: Annotated[Path, typer.Argument(help="Path of the SWI/X to prepare for signing.", callback=_path_exists_callback)],
335+
swiFile: Annotated[Path, typer.Argument(help="Path of the SWI/X to prepare for signing.", callback=_path_exists_callback)],
336336
outfile: Annotated[Optional[Path], typer.Option("--outfile", help="Path to save SWI/X with null signature, if not replacing the input SWI/X.", callback=_path_exists_callback)] = None,
337337
size: Annotated[Optional[int], typer.Option("--size", help="Size of null signature to add.")] = SWI_SIGNATURE_MAX_SIZE,
338338
force: Annotated[Optional[bool], typer.Option("--force-sign", help="Force signing the SWI/X if it's already signed.")] = False,
@@ -342,7 +342,7 @@ def _prepare(
342342
Check SWI/X for existing signature, add a null signature.
343343
"""
344344
try:
345-
prepareSwiHandler(swi_file, outfile, size, force)
345+
prepareSwiHandler(swiFile, outfile, size, force)
346346
except ( IOError, BIO.BIOError, EVP.EVPError ) as e:
347347
print( e, file=sys.stderr )
348348
exit( SWI_SIGN_RESULT.ERROR_INPUT_FILES )
@@ -353,21 +353,21 @@ def _prepare(
353353

354354
@app.command(name="sign")
355355
def _sign(
356-
swi_file: Annotated[Path, typer.Argument(help="Path of the SWI/X to sign.", callback=_path_exists_callback)],
356+
swiFile: Annotated[Path, typer.Argument(help="Path of the SWI/X to sign.", callback=_path_exists_callback)],
357357
certificate: Annotated[Path, typer.Argument(help="Path of the signing certificate.", callback=_path_exists_callback)],
358-
root_certificate: Annotated[Path, typer.Argument(help="Path of the root certificate of signing certificate to verify against.", callback=_path_exists_callback)],
359-
signature_file: Annotated[Optional[Path], typer.Option("--signature", help="Path of base64-encoded SHA-256 signature file of EOS.swi or swix, signed by signing cerificate.", callback=_path_exists_callback)] = None,
360-
signing_key_file: Annotated[Optional[Path], typer.Option("--key", help="Path of signing key, used to generate the signature.", callback=_path_exists_callback)] = None,
358+
rootCertificate: Annotated[Path, typer.Argument(help="Path of the root certificate of signing certificate to verify against.", callback=_path_exists_callback)],
359+
signatureFile: Annotated[Optional[Path], typer.Option("--signature", help="Path of base64-encoded SHA-256 signature file of EOS.swi or swix, signed by signing cerificate.", callback=_path_exists_callback)] = None,
360+
signingKeyFile: Annotated[Optional[Path], typer.Option("--key", help="Path of signing key, used to generate the signature.", callback=_path_exists_callback)] = None,
361361
):
362362
"""
363363
Sign an Arista SWI/X.
364364
The SWI/X must have a null signature, which can be generated with "prepare" option.
365365
"""
366-
if signature_file and signing_key_file:
366+
if signatureFile and signingKeyFile:
367367
raise typer.BadParameter("Cannot specify both --signature and --key")
368368

369369
try:
370-
signSwiHandler(swi_file, certificate, root_certificate, signature_file, signing_key_file)
370+
signSwiHandler(swiFile, certificate, rootCertificate, signatureFile, signingKeyFile)
371371
except ( IOError, BIO.BIOError, EVP.EVPError ) as e:
372372
print( e, file=sys.stderr )
373373
exit( SWI_SIGN_RESULT.ERROR_INPUT_FILES )

src/switools/verify.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ def verifyAllSwi( workDir, swi, rootCA=ROOT_CA_FILE_NAME ):
260260

261261
@app.command(name="verify")
262262
def _verify(
263-
swi_file: Annotated[Path, typer.Argument(help="SWI/X file to verify.", callback=_path_exists_callback)],
264-
ca_file: Annotated[Optional[Path], typer.Option("--CAfile", help="Root certificate to verify against.", callback=_path_exists_callback)] = None,
263+
swiFile: Annotated[Path, typer.Argument(help="SWI/X file to verify.", callback=_path_exists_callback)],
264+
caFile: Annotated[Optional[Path], typer.Option("--CAfile", help="Root certificate to verify against.", callback=_path_exists_callback)] = None,
265265
):
266266
"""
267267
Verify Arista SWI image or SWIX extension.
268268
"""
269269
with tempfile.TemporaryDirectory( prefix="swi-verify-" ) as work_dir:
270-
verifyAllSwi( work_dir, swi_file, ca_file )
270+
verifyAllSwi( work_dir, swiFile, caFile )
271271

272272
if __name__ == "__main__":
273273
app()

0 commit comments

Comments
 (0)