Content-Length: 320167 | pFad | http://github.com/postgrespro/testgres/pull/271/files

D3 Add cwd to ops by demonolock · Pull Request #271 · postgrespro/testgres · GitHub
Skip to content

Add cwd to ops #271

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions testgres/operations/local_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def _run_command__nt(self, cmd, shell, input, stdin, stdout, stderr, get_process
process = subprocess.Popen(
cmd,
shell=shell,
cwd=self.cwd,
stdin=stdin or subprocess.PIPE if input is not None else None,
stdout=stdout,
stderr=stderr,
Expand Down Expand Up @@ -151,6 +152,7 @@ def _run_command__generic(self, cmd, shell, input, stdin, stdout, stderr, get_pr
process = subprocess.Popen(
cmd,
shell=shell,
cwd=self.cwd,
stdin=stdin or subprocess.PIPE if input is not None else None,
stdout=stdout or subprocess.PIPE,
stderr=stderr or subprocess.PIPE,
Expand Down
6 changes: 6 additions & 0 deletions testgres/operations/os_ops.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import getpass
import locale
import os


class ConnectionParams:
Expand All @@ -18,6 +19,7 @@ def get_default_encoding():

class OsOperations:
def __init__(self, username=None):
self.cwd = os.getcwd()
self.ssh_key = None
self.username = username or getpass.getuser()

Expand Down Expand Up @@ -133,3 +135,7 @@ def is_port_free(self, number: int):

def get_tempdir(self) -> str:
raise NotImplementedError()

def set_cwd(self, cwd):
if cwd:
self.cwd = cwd








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/testgres/pull/271/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy