Create the token from the CLI and request the correct data to authenticate via the passed authentication mechanism
(self, eauth, load)
| 785 | return ret |
| 786 | |
| 787 | def token_cli(self, eauth, load): |
| 788 | """ |
| 789 | Create the token from the CLI and request the correct data to |
| 790 | authenticate via the passed authentication mechanism |
| 791 | """ |
| 792 | load["cmd"] = "mk_token" |
| 793 | load["eauth"] = eauth |
| 794 | tdata = self._send_token_request(load) |
| 795 | if "token" not in tdata: |
| 796 | return tdata |
| 797 | try: |
| 798 | with salt.utils.files.set_umask(0o177): |
| 799 | with salt.utils.files.fopen(self.opts["token_file"], "w+") as fp_: |
| 800 | fp_.write(tdata["token"]) |
| 801 | except OSError: |
| 802 | pass |
| 803 | return tdata |
| 804 | |
| 805 | def mk_token(self, load): |
| 806 | """ |
no test coverage detected