Write the remote_map.txt
(self)
| 3768 | return True |
| 3769 | |
| 3770 | def write_remote_map(self): |
| 3771 | """ |
| 3772 | Write the remote_map.txt |
| 3773 | """ |
| 3774 | remote_map = salt.utils.path.join(self.cache_root, "remote_map.txt") |
| 3775 | try: |
| 3776 | with salt.utils.files.fopen(remote_map, "w+") as fp_: |
| 3777 | timestamp = datetime.now().strftime("%d %b %Y %H:%M:%S.%f") |
| 3778 | fp_.write(f"# {self.role}_remote map as of {timestamp}\n") |
| 3779 | for repo in self.remotes: |
| 3780 | fp_.write( |
| 3781 | salt.utils.stringutils.to_str( |
| 3782 | f"{repo.get_cache_basehash()} = {repo.id}\n" |
| 3783 | ) |
| 3784 | ) |
| 3785 | except OSError: |
| 3786 | pass |
| 3787 | else: |
| 3788 | log.info("Wrote new %s remote map to %s", self.role, remote_map) |
| 3789 | |
| 3790 | def do_checkout(self, repo, fetch_on_fail=True): |
| 3791 | """ |
no test coverage detected