On 08/25/2015 06:29 PM, Petr Vobornik wrote:
https://fedorahosted.org/freeipa/ticket/5251



Attaching new rebased version with help text amended.
--
Petr Vobornik
From 07bdc0a3ba7d265cd0a865f1049992d19a4b0e47 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Tue, 25 Aug 2015 18:25:50 +0200
Subject: [PATCH] vault: change default vault type to symmetric

https://fedorahosted.org/freeipa/ticket/5251
---
 API.txt                 |  8 ++++----
 VERSION                 |  4 ++--
 ipalib/plugins/vault.py | 11 ++++++++---
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/API.txt b/API.txt
index 9a0a4b090e9a4fe70dc30147af393acf80206687..afd5017bee2bc1eed54497ccd504b92619ff7a58 100644
--- a/API.txt
+++ b/API.txt
@@ -5411,7 +5411,7 @@ option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
 option: Str('description?', cli_name='desc')
 option: Bytes('ipavaultpublickey?', cli_name='public_key')
-option: Str('ipavaulttype?', cli_name='type')
+option: StrEnum('ipavaulttype?', autofill=True, cli_name='type', default=u'symmetric', values=(u'standard', u'symmetric', u'asymmetric'))
 option: Str('password?', cli_name='password')
 option: Str('password_file?', cli_name='password_file')
 option: Str('public_key_file?', cli_name='public_key_file')
@@ -5431,7 +5431,7 @@ option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui
 option: Str('description', attribute=True, cli_name='desc', multivalue=False, required=False)
 option: Bytes('ipavaultpublickey', attribute=True, cli_name='public_key', multivalue=False, required=False)
 option: Bytes('ipavaultsalt', attribute=True, cli_name='salt', multivalue=False, required=False)
-option: StrEnum('ipavaulttype', attribute=True, autofill=True, cli_name='type', default=u'standard', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
+option: StrEnum('ipavaulttype', attribute=True, autofill=True, cli_name='type', default=u'symmetric', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Str('service?')
@@ -5522,7 +5522,7 @@ arg: Str('criteria?', noextrawhitespace=False)
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
 option: Str('cn', attribute=True, autofill=False, cli_name='name', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.-]+$', primary_key=True, query=True, required=False)
 option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, query=True, required=False)
-option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'standard', multivalue=False, query=True, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
+option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'symmetric', multivalue=False, query=True, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
@@ -5571,7 +5571,7 @@ option: Str('delattr*', cli_name='delattr', exclude='webui')
 option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, required=False)
 option: Bytes('ipavaultpublickey', attribute=True, autofill=False, cli_name='public_key', multivalue=False, required=False)
 option: Bytes('ipavaultsalt', attribute=True, autofill=False, cli_name='salt', multivalue=False, required=False)
-option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'standard', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
+option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'symmetric', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Flag('rights', autofill=True, default=False)
diff --git a/VERSION b/VERSION
index 751c6c7939d1261e421ced6ab6d70f6c42b71faf..d3073e52ee022cc08b74953222a5040929ded60f 100644
--- a/VERSION
+++ b/VERSION
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=153
-# Last change: edewata - Added support for changing vault encryption.
+IPA_API_VERSION_MINOR=154
+# Last change: pvoborni - change default vault type to 'symmetric'
diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py
index 6a07a76b5b85680536b27fd147d8ec1583bb0bc7..667524465031b6d027afbabeea48871e29c0e1e4 100644
--- a/ipalib/plugins/vault.py
+++ b/ipalib/plugins/vault.py
@@ -101,6 +101,7 @@ EXAMPLES:
  Add a standard vault:
    ipa vault-add <name>
        [--user <user>|--service <service>|--shared]
+       --type standard
 """) + _("""
  Add a symmetric vault:
    ipa vault-add <name>
@@ -311,7 +312,7 @@ class vault(LDAPObject):
             label=_('Type'),
             doc=_('Vault type'),
             values=(u'standard', u'symmetric', u'asymmetric', ),
-            default=u'standard',
+            default=u'symmetric',
             autofill=True,
         ),
         Bytes(
@@ -578,10 +579,14 @@ class vault_add(PKQuery, Local):
             cli_name='desc',
             doc=_('Vault description'),
         ),
-        Str(
+        StrEnum(
             'ipavaulttype?',
             cli_name='type',
+            label=_('Type'),
             doc=_('Vault type'),
+            values=(u'standard', u'symmetric', u'asymmetric', ),
+            default=u'symmetric',
+            autofill=True,
         ),
         Str(
             'password?',
@@ -609,7 +614,7 @@ class vault_add(PKQuery, Local):
 
     def forward(self, *args, **options):
 
-        vault_type = options.get('ipavaulttype', u'standard')
+        vault_type = options.get('ipavaulttype')
         password = options.get('password')
         password_file = options.get('password_file')
         public_key = options.get('ipavaultpublickey')
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to