'Attempt to create the key directory if it doesn\'t exist.'

def create_key_directory(self, keystone_user_id=None, keystone_group_id=None):

    if (not os.access(self.key_repository, os.F_OK)):
        LOG.info('key_repository    does    not    appear    to    exist;    attempting    to    create    it')
        try:
            os.makedirs(self.key_repository, 448)
        except OSError:
            LOG.error("Failed    to    create    key_repository:    either    it    already    exists    or    you    don't    have    sufficient    permissions    to    create    it")
        if (keystone_user_id and keystone_group_id):
            os.chown(self.key_repository, keystone_user_id, keystone_group_id)
        elif (keystone_user_id or keystone_group_id):
            LOG.warning('Unable    to    change    the    ownership    of    key_repository    without    a    keystone    user    ID    and    keystone    group    ID    both    being    provided:    %s', self.key_repository)
