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

Adding custom ME management port for scp transfer #295

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions adapters/adtran_generic/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ function scp_from_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = adtran_generic_connect();
if ($ret !== SMS_OK)
Expand Down Expand Up @@ -361,8 +362,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = adtran_generic_connect();

Expand Down
4 changes: 2 additions & 2 deletions adapters/arista_eos/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ function scp_to_router($src, $dst)
$sd_ip_addr = $sd->SD_IP_CONFIG;
$login = $sd->SD_LOGIN_ENTRY;
$passwd = $sd->SD_PASSWD_ENTRY;
$mgt_port=$sd->SD_MANAGEMENT_PORT;
$sd_mgt_port=$sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $mgt_port", $output);
$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

sd_connect();

Expand Down
4 changes: 3 additions & 1 deletion adapters/brocade_vyatta/device_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ function restore_conf()
$login = $this->sd->SD_LOGIN_ENTRY;
$passwd = $this->sd->SD_PASSWD_ENTRY;
$ip_addr = $this->sd->SD_IP_CONFIG;
$cmd = "/opt/sms/bin/sms_scp_transfer -s $full_name -d /tmp/$file_name -l '$login' -a $ip_addr -p '$passwd'";
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$cmd = "/opt/sms/bin/sms_scp_transfer -s $full_name -d /tmp/$file_name -l '$login' -a $ip_addr -p '$passwd -P $sd_mgt_port'";
exec_local(__FILE__ . ':' . __LINE__, $cmd, $output_array);

if ($ret === SMS_OK)
Expand Down
3 changes: 2 additions & 1 deletion adapters/catalyst_ios/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

sd_connect();

Expand Down
5 changes: 3 additions & 2 deletions adapters/cisco_asa_generic/device_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

device_connect();

Expand Down Expand Up @@ -515,4 +516,4 @@ function func_write()
return SMS_OK;
}

?>
?>
6 changes: 4 additions & 2 deletions adapters/cisco_asa_rest/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ function scp_from_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = cisco_asa_rest_connect();
if ($ret !== SMS_OK)
Expand Down Expand Up @@ -332,8 +333,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = cisco_asa_rest_connect();

Expand Down
3 changes: 2 additions & 1 deletion adapters/cisco_ios_xr/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ function scp_from_router($src, $dst)
$sd_ip_addr = $sd->SD_IP_CONFIG;
$login = $sd->SD_LOGIN_ENTRY;
$passwd = $sd->SD_PASSWD_ENTRY;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

sleep(1); // to let the device finish scp execution

Expand Down
3 changes: 2 additions & 1 deletion adapters/cisco_isr/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ function scp_from_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_por", $output);

$ret = cisco_isr_connect();
if ($ret !== SMS_OK)
Expand Down
6 changes: 4 additions & 2 deletions adapters/cisco_nexus9000/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ function scp_from_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = cisco_nexus9000_connect();
if ($ret !== SMS_OK)
Expand Down Expand Up @@ -361,8 +362,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = cisco_nexus9000_connect();

Expand Down
3 changes: 2 additions & 1 deletion adapters/cisco_nx_rest/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ function scp_to_router($src, $dst)
$sd_ip_addr = $sd->SD_IP_CONFIG;
$login = $sd->SD_LOGIN_ENTRY;
$passwd = $sd->SD_PASSWD_ENTRY;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = me_cli_connect();

Expand Down
5 changes: 3 additions & 2 deletions adapters/citrix_adc/citrix_adc_apply_restore_conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ function citrix_netscalar_apply_restore_conf($configuration)
file_put_contents($src, $str);

$dst = "/nsconfig/config-from-msa.cfg";
$sd_mgt_port = $SD->SD_MANAGEMENT_PORT;


$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd -P $sd_mgt_port", $output);
unlink($local_file_name);


Expand Down Expand Up @@ -148,4 +149,4 @@ function citrix_netscalar_apply_restore_conf($configuration)
// sleep(70);
return SMS_OK;
}
?>
?>
6 changes: 4 additions & 2 deletions adapters/citrix_adc/citrix_adc_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ function update_firmware($param = '')
$ipaddr = $sms_sd_ctx->getIpAddress();
$login = $sms_sd_ctx->getLogin();

$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

try
{
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $SD->SD_PASSWD_ENTRY", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $SD->SD_PASSWD_ENTRY -P $sd_mgt_port", $output);
}
catch (Exception | Error $e)
{
Expand Down Expand Up @@ -437,4 +439,4 @@ function update_license()
}
}

?>
?>
5 changes: 3 additions & 2 deletions adapters/citrix_adc/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = citrix_netscalar_connect();

Expand Down Expand Up @@ -544,4 +545,4 @@ function func_write()
return SMS_OK;
}

?>
?>
8 changes: 5 additions & 3 deletions adapters/docker_generic/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ function scp_from_router($src, $dst)

$login = $sd->SD_LOGIN_ENTRY;
$passwd = $sd->SD_PASSWD_ENTRY;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p '$passwd' ", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p '$passwd' -P $sd_mgt_port ", $output);

$ret = me_connect();
if ($ret !== SMS_OK)
Expand Down Expand Up @@ -146,8 +147,9 @@ function scp_to_router($src, $dst)
$sd_ip_addr = $sd->SD_IP_CONFIG;
$login = $sd->SD_LOGIN_ENTRY;
$passwd = $sd->SD_PASSWD_ENTRY;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk/$dst -l $login -a $sd_ip_addr -p '$passwd' ", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk/$dst -l $login -a $sd_ip_addr -p '$passwd' -P $sd_mgt_port", $output);

$ret = me_connect();

Expand Down Expand Up @@ -216,4 +218,4 @@ function check_file_size($local_file, $remote_file, $remove_remote_file = false)
return SMS_OK;
}

?>
?>
5 changes: 3 additions & 2 deletions adapters/esa/esa_apply_conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ function esa_apply_conf($configuration)

$src = $local_file_name;
$dst = "/configuration/config.xml";
$sd_mgt_port = $SD->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $ipaddr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $ipaddr -p $passwd -P $sd_mgt_port", $output);
unlink($local_file_name);

if ($ret_scp !== SMS_OK)
Expand Down Expand Up @@ -215,4 +216,4 @@ function update_password($sms_sd_ctx, $old_passwd, $new_password)
$sms_sd_ctx->sendexpectone(__FILE__ . ':' . __LINE__, $new_password);
}

?>
?>
6 changes: 5 additions & 1 deletion adapters/esa/esa_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ function get_running_conf()
$login = $sms_sd_ctx->getLogin();
$passwd = $sms_sd_ctx->getPassword();

$network = get_network_profile();
$SD = &$network->SD;
$sd_mgt_port = $SD->SD_MANAGEMENT_PORT;

try
{
$ret = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd -r", $output);
$ret = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd -P $sd_mgt_port -r", $output);
if ($ret != SMS_OK)
{
return '';
Expand Down
8 changes: 5 additions & 3 deletions adapters/faere_generic/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ function func_reboot($msg = '')
}
}

function send_file($source, $destination, $ip, $login, $password){
$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $source -d $destination -l $login -a $ip -p '$password' -P 22", $output);
function send_file($source, $destination, $ip, $login, $password, $sd_mgt_port ){


$ret_scp = exec_local(__FILE__.':'.__LINE__, "/opt/sms/bin/sms_scp_transfer -s $source -d $destination -l $login -a $ip -p '$password' -P $sd_mgt_port", $output);
if ($ret_scp !== SMS_OK){
return $ret_scp;
}
return SMS_OK;
}
?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ function restore_conf()
$login = $this->sd->SD_LOGIN_ENTRY;
$password = $this->sd->SD_PASSWD_ENTRY;
$device_ip = $this->sd->SD_IP_CONFIG;
$sd_mgt_port = $this->sd->SD_MANAGEMENT_PORT;
$source = $full_name;
$destination = '/etc/dreddA/tdsconfig.json';
$ret = send_file($source, $destination, $device_ip, $login, $password);
$ret = send_file($source, $destination, $device_ip, $login, $password, $sd_mgt_port);
return $ret;
}

Expand All @@ -100,4 +101,4 @@ function wait_until_device_is_up()

}

?>
?>
6 changes: 4 additions & 2 deletions adapters/fujitsu_ipcom/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ function scp_from_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -r -s $src -d $dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = fujitsu_ipcom_connect();
if ($ret !== SMS_OK)
Expand Down Expand Up @@ -361,8 +362,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst_disk:/$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = fujitsu_ipcom_connect();

Expand Down
5 changes: 3 additions & 2 deletions adapters/juniper_srx/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ function scp_to_router($src, $dst)
$net_profile = get_network_profile();
$sd = &$net_profile->SD;
$sd_ip_addr = $sd->SD_IP_CONFIG;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d /$dst -l $login -a $sd_ip_addr -p $passwd -P $sd_mgt_port", $output);

$ret = juniper_srx_connect();

Expand Down Expand Up @@ -424,4 +425,4 @@ function func_write()
return SMS_OK;
}

?>
?>
5 changes: 3 additions & 2 deletions adapters/juniper_srx/juniper_srx_apply_restore_conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ function juniper_srx_apply_restore_conf($configuration)

$src = $local_file_name;
$dst = "/config/config-from-msa.cfg";

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd", $output);
$sd_mgt_port = $SD->SD_MANAGEMENT_PORT;

$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd -P $sd_mgt_port", $output);
unlink($local_file_name);

if ($ret_scp !== SMS_OK)
Expand Down
12 changes: 9 additions & 3 deletions adapters/juniper_srx/juniper_srx_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ function update_firmware($param = '')

$ipaddr = $sms_sd_ctx->getIpAddress();
$login = $sms_sd_ctx->getLogin();
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;
Copy link
Contributor

Choose a reason for hiding this comment

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

$sd --> $SD


try
{
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $SD->SD_PASSWD_ENTRY", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $SD->SD_PASSWD_ENTRY -P $sd_mgt_port", $output);
}
catch (Exception | Error $e)
{
Expand Down Expand Up @@ -408,10 +409,15 @@ function update_license()
$ipaddr = $sms_sd_ctx->getIpAddress();
$login = $sms_sd_ctx->getLogin();
$passwd = $sms_sd_ctx->getPassword();

$network= get_network_profile();
$SD = &$network->SD;
$sd_mgt_port = $SD->SD_MANAGEMENT_PORT;
$sd_mgt_port = $sd->SD_MANAGEMENT_PORT;
Copy link
Contributor

Choose a reason for hiding this comment

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

$sd is not initialized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed by this commit d5ee499

Copy link
Contributor

Choose a reason for hiding this comment

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

line 416 should not be there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed by commit 4c21b11


try
{
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd", $output);
$ret_scp = exec_local(__FILE__ . ':' . __LINE__, "/opt/sms/bin/sms_scp_transfer -s $src -d $dst -l $login -a $ipaddr -p $passwd -P $sd_mgt_port", $output);
}
catch (Exception | Error $e)
{
Expand All @@ -437,4 +443,4 @@ function update_license()
}
}

?>
?>
Loading