Change in osmo-ttcn3-hacks[master]: library/Osmocom_VTY_Functions: cosmetic: coding style changes

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Jan 30 13:23:51 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22547 )


Change subject: library/Osmocom_VTY_Functions: cosmetic: coding style changes
......................................................................

library/Osmocom_VTY_Functions: cosmetic: coding style changes

Change-Id: Idccdf6fcbda2d020d2263ea1440ea1c5d9ea0e45
---
M library/Osmocom_VTY_Functions.ttcn
1 file changed, 27 insertions(+), 26 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/22547/1

diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn
index b291b03..a9f4c24 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -56,39 +56,40 @@
 	}
 
 	/* wait for any of the permitted prompts; buffer + return all intermediate output */
-	function f_vty_wait_for_prompt(TELNETasp_PT pt, boolean strict := true, charstring log_label := "(?)") return charstring {
+	function f_vty_wait_for_prompt(TELNETasp_PT pt, boolean strict := true, charstring log_label := "(?)")
+	return charstring {
 		var charstring rx, buf := "";
 		var integer fd;
 		timer T := 2.0;
 
 		T.start;
 		alt {
-			[] pt.receive(pattern "[\w-]+" & VTY_VIEW_SUFFIX) { };
-			[] pt.receive(pattern "[\w-]+\# ") { };
-			[] pt.receive(pattern "[\w-]+\(*\)\# ") { };
-			[] pt.receive(t_vty_unknown) -> value rx {
-				if (strict) {
-					setverdict(fail, "VTY: Unknown Command: " & log_label);
-					mtc.stop;
-				} else {
-					log("VTY: Unknown Command (ignored): " & log_label);
-					buf := buf & rx;
-					repeat;
-				}
-				};
-			[] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat };
-			[] pt.receive(integer:?) -> value fd {
-				if (fd == -1) {
-					setverdict(fail, "VTY Telnet Connection Failure: " & log_label);
-					mtc.stop;
-				} else {
-					repeat; /* telnet connection succeeded */
-				}
-			}
-			[] T.timeout {
-				setverdict(fail, "VTY Timeout for prompt: " & log_label);
+		[] pt.receive(pattern "[\w-]+" & VTY_VIEW_SUFFIX) { };
+		[] pt.receive(pattern "[\w-]+\# ") { };
+		[] pt.receive(pattern "[\w-]+\(*\)\# ") { };
+		[] pt.receive(t_vty_unknown) -> value rx {
+			if (strict) {
+				setverdict(fail, "VTY: Unknown Command: " & log_label);
 				mtc.stop;
-				};
+			} else {
+				log("VTY: Unknown Command (ignored): " & log_label);
+				buf := buf & rx;
+				repeat;
+			}
+			};
+		[] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat };
+		[] pt.receive(integer:?) -> value fd {
+			if (fd == -1) {
+				setverdict(fail, "VTY Telnet Connection Failure: " & log_label);
+				mtc.stop;
+			} else {
+				repeat; /* telnet connection succeeded */
+			}
+		}
+		[] T.timeout {
+			setverdict(fail, "VTY Timeout for prompt: " & log_label);
+			mtc.stop;
+			};
 		}
 		T.stop;
 		return buf;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22547
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Idccdf6fcbda2d020d2263ea1440ea1c5d9ea0e45
Gerrit-Change-Number: 22547
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210130/24132281/attachment.htm>


More information about the gerrit-log mailing list