Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
EOS-23243 fix for confstore create failed intermittent issue (#6009)
Browse files Browse the repository at this point in the history
* EOS-23243 fix for confstore create failed intermittent issue

Signed-off-by: zahid.shaikh <zahid.shaikh@seagate.com>

* EOS-23243 fix for confstore create failed intermittent issue

Signed-off-by: zahid.shaikh <zahid.shaikh@seagate.com>

* EOS-23243 Review comments incorporated

Signed-off-by: zahid.shaikh <zahid.shaikh@seagate.com>

Co-authored-by: Nitin <75619801+nitin-seagate@users.noreply.github.com>
  • Loading branch information
zahidsk and nitin-seagate authored Jul 30, 2021
1 parent 9831668 commit 8904f60
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
9 changes: 6 additions & 3 deletions lr-cli/cortx_setup/commands/pillar_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

from .command import Command
from provisioner.salt import cmd_run, StatesApplier
from provisioner.salt import cmd_run, StatesApplier, local_minion_id
from cortx_setup import config
from provisioner.commands import PillarSet
from provisioner.config import (
Expand Down Expand Up @@ -51,8 +51,11 @@ def run(self, **kwargs):
conf_path = str(PRVSNR_FACTORY_PROFILE_DIR / 'confstore')
# backup local consftore data
self.logger.debug(f"Copy local confstore file to {conf_path}")
state = 'components.provisioner.confstore'
StatesApplier.apply([state])
conf_create = 'components.provisioner.confstore_create'
StatesApplier.apply([conf_create], targets=local_minion_id())

conf_copy = 'components.provisioner.confstore_copy'
StatesApplier.apply([conf_copy])
# backup local pillar data
cmd_run(f"rm -rf {PRVSNR_DATA_ROOT_DIR}/.backup ")
cmd_run(f"mkdir -p {PRVSNR_DATA_ROOT_DIR}/.backup")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@

{% set profile_confstore = "/var/lib/seagate/cortx/provisioner/shared/factory_profile/confstore" %}

Create confstore dir in profile path:
file.directory:
- name: {{ profile_confstore }}
- user: root
- group: root
- dir_mode: 640
- makedirs: True


Copy confstore file:
file.managed:
Expand Down
26 changes: 26 additions & 0 deletions srv/components/provisioner/confstore_create.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# For any questions about this software or licensing,
# please email opensource@seagate.com or cortx-questions@seagate.com.
#

{% set profile_confstore = "/var/lib/seagate/cortx/provisioner/shared/factory_profile/confstore" %}

Create confstore dir in profile path:
file.directory:
- name: {{ profile_confstore }}
- user: root
- group: root
- dir_mode: 640
- makedirs: True

0 comments on commit 8904f60

Please sign in to comment.