Merge "Default to user home directory to read krb5.keytab"
This commit is contained in:
commit
35d07534e0
|
@ -13,6 +13,8 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
service_option = cfg.BoolOpt("novajoin",
|
service_option = cfg.BoolOpt("novajoin",
|
||||||
|
@ -29,7 +31,7 @@ NovajoinGroup = [
|
||||||
default='vm',
|
default='vm',
|
||||||
help='Flavor tag to use in novajoin enrollment tests'),
|
help='Flavor tag to use in novajoin enrollment tests'),
|
||||||
cfg.StrOpt('keytab',
|
cfg.StrOpt('keytab',
|
||||||
default='/home/stack/novajoin.keytab',
|
default=os.path.expanduser('~/novajoin.keytab'),
|
||||||
help='Keytab to connect to IPA as the novajoin user'),
|
help='Keytab to connect to IPA as the novajoin user'),
|
||||||
cfg.StrOpt('tripleo',
|
cfg.StrOpt('tripleo',
|
||||||
default='True',
|
default='True',
|
||||||
|
|
|
@ -51,9 +51,12 @@ class IPABase(object):
|
||||||
except cfg.NoSuchOptError:
|
except cfg.NoSuchOptError:
|
||||||
self.keytab = '/etc/novajoin/krb5.keytab'
|
self.keytab = '/etc/novajoin/krb5.keytab'
|
||||||
|
|
||||||
|
with open(self.keytab):
|
||||||
|
pass # Throw a nicer exception if krb5.keytab does not exist
|
||||||
|
|
||||||
self.ccache = "MEMORY:" + str(uuid.uuid4())
|
self.ccache = "MEMORY:" + str(uuid.uuid4())
|
||||||
os.environ['KRB5CCNAME'] = self.ccache
|
os.environ['KRB5CCNAME'] = self.ccache
|
||||||
os.environ['KRB5_CLIENT_KTNAME'] = '/home/stack/krb5.keytab'
|
os.environ['KRB5_CLIENT_KTNAME'] = self.keytab
|
||||||
if self._ipa_client_configured() and not api.isdone('finalize'):
|
if self._ipa_client_configured() and not api.isdone('finalize'):
|
||||||
api.bootstrap(context='novajoin')
|
api.bootstrap(context='novajoin')
|
||||||
api.finalize()
|
api.finalize()
|
||||||
|
|
Loading…
Reference in New Issue