Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zwe init --update-config does not work if the file is already open #3887

Closed
Rahul-Kejriwal opened this issue Jul 1, 2024 · 4 comments
Closed

Comments

@Rahul-Kejriwal
Copy link

Describe the bug
--update-config param in zwe init does not update zowe.yaml file if zowe.yaml already open but the messages in the log still says that it was updated successfully

To Reproduce
Steps to reproduce the behavior:

  1. open the zowe.yaml in editor
  2. Execute the zwe init command with --update-config
  3. The log messages say the yaml file was updated in the zowe.certicate section
  4. The zowe.yaml file was Not updated.

Expected behavior
--update-config parameter always updates zowe.yaml file and generate error messages like 'File already Open' or 'File in use' in case it's not able to update the file.

Logs

-------------------------------------------------------------------------------
>> Update certificate configuration to zowe.yaml

- update "zowe.certificate.keystore.type" with value: PKCS12
- update "zowe.certificate.keystore.file" with value: /var/lpp/zowe/v2/keystore/localhost/localhost.keystore.p12
- update "zowe.certificate.keystore.password" with value: password
- update "zowe.certificate.keystore.alias" with value: localhost
- update "zowe.certificate.truststore.type" with value: PKCS12
- update "zowe.certificate.truststore.file" with value: /var/lpp/zowe/v2/keystore/localhost/localhost.truststore.p12
- update "zowe.certificate.truststore.password" with value: password
- update "zowe.certificate.pem.key" with value: /var/lpp/zowe/v2/keystore/localhost/localhost.key
- update "zowe.certificate.pem.certificate" with value: /var/lpp/zowe/v2/keystore/localhost/localhost.cer
- update "zowe.certificate.pem.certificateAuthorities" with value: /var/lpp/zowe/v2/keystore/local_ca/local_ca.cer

>> Zowe configuration is updated successfully.

-------------------------------------------------------------------------------

Additional context
The above Log messages issued says that the zowe.yaml config file has been updated but actually it was not since the file was already in use.

@MarkAckert
Copy link
Member

In this scenario, where was the zowe.yaml file opened? Zowe Explorer for VSCode, ISPF, USS + VI/VIM?

@Rahul-Kejriwal
Copy link
Author

zowe.yaml was opened in Zowe Explorer for VSCode.

@MarkAckert
Copy link
Member

The Zowe Explorer for VSCode does not lock the remote file in USS, so the zwe init ... --update-config flag would have worked as expected on the backend and modified zowe.yaml. To reflect those changes to zowe.yaml your VSCode environment, you need to right click the file in Zowe Explorer for VSCode and select Pull from mainframe to see the latest changes. If you didn't run the Pull from mainframe and saved the zowe.yaml file in your VSCode environment, it would overwrite the remote file which reverts the changes made by --update-config.

I don't believe there's any way to lock a USS file today using Zowe Explorer, or that zwe init would respect the lock.

cc @adam-wolfe for awareness and in case I misstated anything.

@Rahul-Kejriwal
Copy link
Author

Rahul-Kejriwal commented Jul 5, 2024

Hi Mark,
I think you were right that we would see the changes when we pull from mainframe after the successful completion of zwe init command.

I think we can close this issue.
Thanks.

@jp669844 jp669844 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants