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

Create a shadow ZTP data json file accessible to non-root user #13

Merged

Conversation

rajendra-dendukuri
Copy link
Collaborator

To allow non-root user to view status information, a shadow file for the current
ztp_data.json is created. The shadow file (ztp_data_shadow.json) contains only
status information which does not provide knowledge of url's of the
configuration scripts used for ztp. The ztp_data_shadow.json file is updated
everytume ztp_data.json is updated. The ztp_data_shadow.json is accessible to
non-root user as well while ztp_data.json is accessible only to root user and
has more information about the url's where configuration scripts can be downloaded
from.

Signed-off-by: Rajendra Dendukuri rajendra.dendukuri@broadcom.com

To allow non-root user to view status information, a shadow file for the current
ztp_data.json is created. The shadow file (ztp_data_shadow.json) contains only
status information which does not provide knowledge of url's of the
configuration scripts used for ztp. The ztp_data_shadow.json file is updated
everytume ztp_data.json is updated. The ztp_data_shadow.json is accessible to
non-root user as well while ztp_data.json is accessible only to root user and
has more information about the url's where configuration scripts can be downloaded
from.

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
@lguohan lguohan merged commit 1018662 into sonic-net:master Apr 29, 2020
lguohan pushed a commit to sonic-net/sonic-utilities that referenced this pull request Apr 29, 2020
…ot user (#872)

Removed user privileges checks. These changes fix #800. The ZTP PR sonic-net/sonic-ztp#13 is also required for these changes to work as expected.

```
admin@sonic:~$ show ztp status
ZTP Admin Mode : True
ZTP Service : Processing
ZTP Status : IN-PROGRESS
ZTP Source : local-fs (/host/ztp/ztp_data_local.json)
Runtime : 06m 26s
Timestamp : 2020-04-08 13:08:22 UTC

ZTP Service is active

01-test-plugin: IN-PROGRESS
```

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
…ot user (sonic-net#872)

Removed user privileges checks. These changes fix sonic-net#800. The ZTP PR sonic-net/sonic-ztp#13 is also required for these changes to work as expected.

```
admin@sonic:~$ show ztp status
ZTP Admin Mode : True
ZTP Service : Processing
ZTP Status : IN-PROGRESS
ZTP Source : local-fs (/host/ztp/ztp_data_local.json)
Runtime : 06m 26s
Timestamp : 2020-04-08 13:08:22 UTC

ZTP Service is active

01-test-plugin: IN-PROGRESS
```

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
@liat-grozovik
Copy link

@rajendra-dendukuri and @lguohan
As the issue is fixing an issue found on 201911 (used in production in many places) can you have it also cherry picked to 201911?

malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
…ot user (#872)

Removed user privileges checks. These changes fix #800. The ZTP PR sonic-net/sonic-ztp#13 is also required for these changes to work as expected.

```
admin@sonic:~$ show ztp status
ZTP Admin Mode : True
ZTP Service : Processing
ZTP Status : IN-PROGRESS
ZTP Source : local-fs (/host/ztp/ztp_data_local.json)
Runtime : 06m 26s
Timestamp : 2020-04-08 13:08:22 UTC

ZTP Service is active

01-test-plugin: IN-PROGRESS
```

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
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.

3 participants