diff options
author | Jan Safranek <jsafrane@redhat.com> | 2014-04-25 13:09:49 +0200 |
---|---|---|
committer | Jan Safranek <jsafrane@redhat.com> | 2014-04-25 13:09:49 +0200 |
commit | 36d31ddfe0bbdc4071aa695a5a4db8b49840d7b3 (patch) | |
tree | 6500eb699cacc8b64b594b3b820525d558337630 /commands/storage/lmi/scripts/storage/luks.py | |
parent | ab96a6cf650ef72b10f356da09da05d8fd89f7e8 (diff) | |
download | openlmi-scripts-36d31ddfe0bbdc4071aa695a5a4db8b49840d7b3.tar.gz openlmi-scripts-36d31ddfe0bbdc4071aa695a5a4db8b49840d7b3.tar.xz openlmi-scripts-36d31ddfe0bbdc4071aa695a5a4db8b49840d7b3.zip |
Added operation result logs.
These will be visible with 'lmi -v'.
Diffstat (limited to 'commands/storage/lmi/scripts/storage/luks.py')
-rw-r--r-- | commands/storage/lmi/scripts/storage/luks.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/commands/storage/lmi/scripts/storage/luks.py b/commands/storage/lmi/scripts/storage/luks.py index 79b0fe0..35cccb7 100644 --- a/commands/storage/lmi/scripts/storage/luks.py +++ b/commands/storage/lmi/scripts/storage/luks.py @@ -74,6 +74,8 @@ def create_luks(ns, device, passphrase): values = service.CreateEncryptionFormat.CreateEncryptionFormatValues raise LmiFailed("Cannot create LUKS format: %s." % (values.value_name(ret),)) + + LOG().info("Created LUKS on %s", device.Name) return outparams['Format'] @@ -103,7 +105,10 @@ def open_luks(ns, fmt, name, passphrase): values = service.OpenEncryptionFormat.OpenEncryptionFormatValues raise LmiFailed("Cannot open LUKS format: %s." % (values.value_name(ret),)) - return outparams['Extent'] + + opened = outparams['Extent'].to_instance() + LOG().info("Opened LUKS on %s as %s", fmt.ElementName, opened.Name) + return opened def close_luks(ns, fmt): """ @@ -121,6 +126,7 @@ def close_luks(ns, fmt): values = service.CloseEncryptionFormat.CloseEncryptionFormatValues raise LmiFailed("Cannot close LUKS format: %s." % (values.value_name(ret),)) + LOG().info("Closed LUKS on %s", fmt.ElementName) def add_luks_passphrase(ns, fmt, passphrase, new_passphrase): """ @@ -152,6 +158,7 @@ def add_luks_passphrase(ns, fmt, passphrase, new_passphrase): values = service.AddPassphrase.AddPassphraseValues raise LmiFailed("Cannot add new passphrase: %s." % (values.value_name(ret),)) + LOG().info("Added passphrase to %s", fmt.ElementName) def delete_luks_passphrase(ns, fmt, passphrase): """ @@ -173,6 +180,7 @@ def delete_luks_passphrase(ns, fmt, passphrase): values = service.DeletePassphrase.DeletePassphraseValues raise LmiFailed("Cannot delete passphrase: %s." % (values.value_name(ret),)) + LOG().info("Deleted passphrase from %s", fmt.ElementName) def get_luks_device(ns, fmt): """ |