Skip to content

Conversation

@LunfanZhang
Copy link
Contributor

As title, merge SSH management feature to XS8

BengangY and others added 4 commits March 27, 2025 09:09
Currently, xsconsole uses systemd to manage ssh service.
In the ssh configuration feature (CP-50702), ssh's status is saved in xapi DB
and is updated by xapi API.
So change the way of managing ssh to xapi API in xsconsole to keep the ssh's
status updating.

Signed-off-by: Bengang Yuan <[email protected]>
Copy link
Collaborator

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I'd like to propose to please rename the global variables DISABLE, ENABLE and AUTO to be more specific (SSH_MODE_ENABLE, SSH_MODE_ENABLE, SSH_MODE_AUTO.

To not use the global scope unless actually were needed (global variables do not have a great reputation and are lumped to gether on the top of the file), I'd like to propose to move them to class variables of the class that uses them and then let those classes referto them using self.SSH_MODE_ENABLE, self.SSH_MODE_ENABLE, self.SSH_MODE_AUTO.

This makes the calls that use these variables as arguments more self-explanatory. Comments would be an alternative, but not a great alternative, as adding comments is not needed when the variable names are self-explanatory.

@LunfanZhang
Copy link
Contributor Author

Hi,

I'd like to propose to please rename the global variables DISABLE, ENABLE and AUTO to be more specific (SSH_MODE_ENABLE, SSH_MODE_ENABLE, SSH_MODE_AUTO.

To not use the global scope unless actually were needed (global variables do not have a great reputation and are lumped to gether on the top of the file), I'd like to propose to move them to class variables of the class that uses them and then let those classes referto them using self.SSH_MODE_ENABLE, self.SSH_MODE_ENABLE, self.SSH_MODE_AUTO.

This makes the calls that use these variables as arguments more self-explanatory. Comments would be an alternative, but not a great alternative, as adding comments is not needed when the variable names are self-explanatory.

Hi, I have refactor the variable name #68, and I can not move these variable to class, as there are two class DisableOptionsDialogue and RemoteShellDialogue use them.

@LunfanZhang LunfanZhang changed the base branch from master to release/xs8 July 30, 2025 10:29
Copy link
Collaborator

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updates done! I set my comments to resolved! Approving hereby!

@BengangY BengangY merged commit 3af1114 into release/xs8 Jul 31, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

4 participants