[systemd-generator]: Remove creation of NUM_ASIC environment (#5122)

NUM_ASIC environment variable was added so that it could be used by other utilities.
This is not being used by any other utility or docker, hence removing the addition of NUM_ASIC environment variable.
Also, the environment variable was added by adding the variable value to /etc/environ file.
Upon each reboot, this file gets updated with the NUM_ASIC value but the existing value was not removed.
This causes multiple lines getting appended in /etc/environ file upon each reboot.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
This commit is contained in:
SuvarnaMeenakshi 2020-08-11 13:58:20 -07:00 committed by Abhishek Dosi
parent fe8ee92f83
commit 5b90f69238

View File

@ -498,7 +498,6 @@ static int get_num_of_asic() {
Determines if the current platform is single or multi-ASIC
***/
FILE *fp;
FILE *env_fp;
char *line = NULL;
char* token;
char* platform;
@ -546,15 +545,6 @@ static int get_num_of_asic() {
free(line);
}
}
/*set environment variable NUM_ASIC */
env_fp = fopen("/etc/environment", "a");
if (env_fp == NULL) {
fprintf(stderr, "Failed to open environment file\n");
exit(EXIT_FAILURE);
}
fprintf(env_fp, "NUM_ASIC=%d\n", num_asic);
fclose(env_fp);
return num_asic;
}