db-sync-tool-kmi 2.11.1__py3-none-any.whl → 2.11.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of db-sync-tool-kmi might be problematic. Click here for more details.

db_sync_tool/info.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """
2
2
  Info script
3
3
  """
4
- __version__ = "2.11.1"
4
+ __version__ = "2.11.3"
5
5
  __pypi_package_url__ = "https://pypi.org/pypi/db-sync-tool-kmi"
6
6
  __homepage__ = "https://github.com/jackd248/db-sync-tool"
@@ -20,6 +20,7 @@ default_options = [
20
20
  '--chmod=D2770,F660'
21
21
  ]
22
22
 
23
+
23
24
  def get_password_environment(client):
24
25
  """
25
26
  Optionally create a password environment variable for sshpass password authentication
@@ -122,20 +123,25 @@ def unit_converter(size_in_bytes):
122
123
  """
123
124
  units = ['Bytes', 'kB', 'MB', 'GB']
124
125
 
125
- _convertedSize = float(size_in_bytes)
126
- for unit in units:
127
- if _convertedSize < 1024:
128
- return str(_convertedSize) + ' ' + unit
129
- _convertedSize = _convertedSize/1024
126
+ if isinstance(size_in_bytes, (int, float)):
127
+ _convertedSize = float(size_in_bytes)
128
+ for unit in units:
129
+ if _convertedSize < 1024:
130
+ return str(_convertedSize) + ' ' + unit
131
+ _convertedSize = _convertedSize / 1024
130
132
 
131
- return _convertedSize
133
+ return _convertedSize
134
+ return size_in_bytes
132
135
 
133
136
 
134
- def run_rsync_command(remote_client, origin_path, target_path, origin_ssh = '', target_ssh = ''):
137
+ def run_rsync_command(remote_client, origin_path, target_path, origin_ssh='', target_ssh=''):
135
138
  """
136
139
 
137
- :param localpath:
138
- :param remotepath:
140
+ :param target_ssh:
141
+ :param origin_ssh:
142
+ :param target_path:
143
+ :param origin_path:
144
+ :param remote_client:
139
145
  :return:
140
146
  """
141
147
  if origin_ssh != '':
@@ -151,4 +157,3 @@ def run_rsync_command(remote_client, origin_path, target_path, origin_ssh = '',
151
157
  True
152
158
  )
153
159
  read_stats(_output)
154
-
@@ -29,11 +29,15 @@ def remove_origin_database_dump(keep_compressed_file=False):
29
29
 
30
30
  _file_path = helper.get_dump_dir(mode.Client.ORIGIN) + database_utility.database_dump_file_name
31
31
  if mode.is_origin_remote():
32
- sftp = remote_client.ssh_client_origin.open_sftp()
33
- sftp.remove(_file_path)
32
+ mode.run_command(
33
+ f'{helper.get_command(mode.Client.ORIGIN, 'rm')} {_file_path}',
34
+ mode.Client.ORIGIN
35
+ )
34
36
  if not keep_compressed_file:
35
- sftp.remove(f'{_file_path}.tar.gz')
36
- sftp.close()
37
+ mode.run_command(
38
+ f'{helper.get_command(mode.Client.ORIGIN, 'rm')} {_file_path}.tar.gz',
39
+ mode.Client.ORIGIN
40
+ )
37
41
  else:
38
42
  os.remove(_file_path)
39
43
  if not keep_compressed_file:
@@ -92,10 +96,14 @@ def remove_target_database_dump():
92
96
  return
93
97
 
94
98
  if mode.is_target_remote():
95
- sftp = remote_client.ssh_client_target.open_sftp()
96
- sftp.remove(_file_path)
97
- sftp.remove(f'{_file_path}.tar.gz')
98
- sftp.close()
99
+ mode.run_command(
100
+ f'{helper.get_command(mode.Client.TARGET, 'rm')} {_file_path}',
101
+ mode.Client.TARGET
102
+ )
103
+ mode.run_command(
104
+ f'{helper.get_command(mode.Client.TARGET, 'rm')} {_file_path}.tar.gz',
105
+ mode.Client.TARGET
106
+ )
99
107
  else:
100
108
  if os.path.isfile(_file_path):
101
109
  os.remove(_file_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: db-sync-tool-kmi
3
- Version: 2.11.1
3
+ Version: 2.11.3
4
4
  Summary: Synchronize a database from and to host systems.
5
5
  Home-page: https://github.com/jackd248/db-sync-tool
6
6
  Author: Konrad Michalik
@@ -220,7 +220,7 @@ optional arguments:
220
220
  -w WHERE, --where WHERE
221
221
  Additional where clause for mysql dump to sync only selected rows, e.g. --where="deleted=0"
222
222
  -amo OPTIONS, --additional-mysqldump-options OPTIONS
223
- Additional where clause for mysql dump to sync only selected rows, e.g. --where="deleted=0"
223
+ Additional mysqldump options for creating the database dump, e.g. --additional-mysqldump-options="--where="deleted=0"
224
224
  ```
225
225
 
226
226
  If you haven't declared a path to a SSH key, during the script execution you are requested to enter the SSH password for the given user in the shell argument or the `config.json` to enable a SSH connection for the remote system.
@@ -1,6 +1,6 @@
1
1
  db_sync_tool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  db_sync_tool/__main__.py,sha256=-pD13j2oYcKLhPprLy-LQeDCapj-FKrV3CDFHuYJu3g,11541
3
- db_sync_tool/info.py,sha256=zvJb_plR5CL6T5IYZObECTY_7Km79XQ2jgPTTeUXNF8,165
3
+ db_sync_tool/info.py,sha256=FPLspF2F39NbrqdmhApBJY9jaQlDc7pA8-708-2CLiE,165
4
4
  db_sync_tool/sync.py,sha256=WMfMts0M8z3oecI-HL07xG9ktbba8D8h7_U-8tBwizY,2087
5
5
  db_sync_tool/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  db_sync_tool/database/process.py,sha256=6KiYyCVk68tJbyGNfVeIwYyTMkk5jCoOiVdWoLnrDHw,8365
@@ -13,10 +13,10 @@ db_sync_tool/recipes/typo3.py,sha256=7ThFTkqN086FcpYv_aUhxMTEKh2JQl6BB5VrFzNrEWA
13
13
  db_sync_tool/recipes/wordpress.py,sha256=Cdjc10c30shHAG8WpQeFvhl8fojHeCto3UInRLb9FFU,1444
14
14
  db_sync_tool/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  db_sync_tool/remote/client.py,sha256=wjcoQ1jp9i8PMO_6XX2XMXZCoLXy-ySA38seZtY-Sns,6553
16
- db_sync_tool/remote/rsync.py,sha256=sX5s_G89qE6E19TJrOranvGLUP-aSin00SXC7J63ykE,4082
16
+ db_sync_tool/remote/rsync.py,sha256=VsLbCCgZRSXjmYz5o7B_OpKPna0X1WFqlr-irLN83EY,4252
17
17
  db_sync_tool/remote/system.py,sha256=A9OIaypETMYx7frTKpXBgja-kXj7vSD6gJs8pUNpL_I,1188
18
18
  db_sync_tool/remote/transfer.py,sha256=pYVsad4SKkJ0TgZHcyLc17Z9xK6exdyO7R8TBe4qQcQ,5872
19
- db_sync_tool/remote/utility.py,sha256=-T4o62i41LGlTOlinX5KplcQQz5_Rdzk11Hjj1Bb48I,3264
19
+ db_sync_tool/remote/utility.py,sha256=s7yuA7bAv4gUEgfK7cHleZpBQd4XB60NvQgPXRZfhik,3570
20
20
  db_sync_tool/utility/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  db_sync_tool/utility/helper.py,sha256=KSnps4JQHc-wUmi8HNqI1d836R4ZUiQJo94t1gYNFuo,7987
22
22
  db_sync_tool/utility/info.py,sha256=8VdUMi3fsyykfMKKrmgUVoW9WEHPXbzPkVNHOIsNAMo,2976
@@ -26,9 +26,9 @@ db_sync_tool/utility/output.py,sha256=uoiWE7Pm8qv1a3vrBupZHE545d1uZSQHiLAUgkHofL
26
26
  db_sync_tool/utility/parser.py,sha256=DIdWVGyiltyH8akoWyyXLvUmFPR-nvBrnzDctPJzgKw,6624
27
27
  db_sync_tool/utility/system.py,sha256=G74lWGFcJNmLr0l6-GkZWmkk7q3icv4MccuHFKP_Vsw,18539
28
28
  db_sync_tool/utility/validation.py,sha256=qZNPgkTwV_kJTNtFh0OXb2FHrsWPnDA2W_fftWs5hZc,3530
29
- db_sync_tool_kmi-2.11.1.dist-info/LICENSE,sha256=o_R9gPKBRl4PQVcGCrWuTYsJQJ7uuQDcDaq-wapBUaw,1082
30
- db_sync_tool_kmi-2.11.1.dist-info/METADATA,sha256=LBIbZMmJeLcRTz2-pvDlcNOwaAStmWDH6LlDS-XhrYs,12479
31
- db_sync_tool_kmi-2.11.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
32
- db_sync_tool_kmi-2.11.1.dist-info/entry_points.txt,sha256=bVk6UR_ejpfY2oSCoOii7uKQivwV9MtA6Tdqpjg4Yvo,60
33
- db_sync_tool_kmi-2.11.1.dist-info/top_level.txt,sha256=Uj5hJLhmdynFrBE0VnX0PfgIBC8_n7h2vgldqUQ-xfw,13
34
- db_sync_tool_kmi-2.11.1.dist-info/RECORD,,
29
+ db_sync_tool_kmi-2.11.3.dist-info/LICENSE,sha256=o_R9gPKBRl4PQVcGCrWuTYsJQJ7uuQDcDaq-wapBUaw,1082
30
+ db_sync_tool_kmi-2.11.3.dist-info/METADATA,sha256=am2k5dWEhIftg-zWavGHjxDQz4-KPm18-3NIatgNy3s,12505
31
+ db_sync_tool_kmi-2.11.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
32
+ db_sync_tool_kmi-2.11.3.dist-info/entry_points.txt,sha256=bVk6UR_ejpfY2oSCoOii7uKQivwV9MtA6Tdqpjg4Yvo,60
33
+ db_sync_tool_kmi-2.11.3.dist-info/top_level.txt,sha256=Uj5hJLhmdynFrBE0VnX0PfgIBC8_n7h2vgldqUQ-xfw,13
34
+ db_sync_tool_kmi-2.11.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5