Skip to content

Commit

Permalink
[orchagent]: Adding disable record flag (sonic-net#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored and Shuotian Cheng committed Mar 15, 2017
1 parent d5d6318 commit 837ea86
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,15 @@ int main(int argc, char **argv)
int opt;
sai_status_t status;

while ((opt = getopt(argc, argv, "m:h")) != -1)
bool disableRecord = false;

while ((opt = getopt(argc, argv, "m:hR")) != -1)
{
switch (opt)
{
case 'R':
disableRecord = true;
break;
case 'm':
gMacAddress = MacAddress(optarg);
break;
Expand All @@ -173,7 +178,7 @@ int main(int argc, char **argv)

sai_attribute_t attr;
attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
attr.value.booldata = true;
attr.value.booldata = !disableRecord;

status = sai_switch_api->set_switch_attribute(&attr);

Expand Down

0 comments on commit 837ea86

Please sign in to comment.