internal TaskContext(ICommandShell commandShell) { this.CommandShell = commandShell; this.UniqueId = Guid.NewGuid(); this.CurrentObjectIndex = -1; this.Items = new Dictionary <string, object>(); this.ErrorInfo = new TaskErrorInfo(); }
public override void OpenDatabase(ICommandShell shell, ICmdLineConnection conn) { string verstr = "Server version:"; string pwdstr = "Enter password:"******"$")) { s = shell.ReadLineAndWait(); } //m_shell.WriteLine("echo cau"); shell.WriteLine("mysql -p -u " + conn.Params.Login); //System.Threading.Thread.Sleep(2000); //m_shell.WriteLine("echo cau"); //int b = m_outstream.ReadByte(); //string s = shell.ReadLineAndWait(); s = shell.ReadLineAndWait(); while (s != null && !s.Contains(verstr) && !s.StartsWith(pwdstr)) { s = shell.ReadLineAndWait(); } if (s != null && s.StartsWith(pwdstr)) { shell.WriteLine(conn.Params.Password); s = shell.ReadLineAndWait(); } while (s != null && !s.Contains(verstr)) { s = shell.ReadLineAndWait(); } if (s != null && s.Contains(verstr)) { string version = s.Substring(verstr.Length).Trim(); if (version.Contains(" ")) { version = version.Substring(0, version.IndexOf(" ")).Trim(); } conn.SetVersion(version); } }
public KubernetesCluster(ICommandShell shell) { Guard.IsNotNull(shell, nameof(shell)); Shell = shell; }
public abstract void OpenDatabase(ICommandShell shell, ICmdLineConnection conn);