On 07/25/2016 01:52 PM, Dimitrios Apostolou wrote:
> I'm wondering why this wouldn't work. The debug logs should show full
> network traffic, can you post the snippet around the copy_from files
> promise?
It seems to get the remote hash before deciding that no copying is
required since the destination file already exists.
```
verbose: P: .........................................................
verbose: P: BEGIN promise 'promise_copy_from_unless_file_exists_cf_7'
of type "files" (pass 1)
verbose: P: Promiser/affected object: '/var/cfengine/inputs/
promises.cf'
verbose: P: Part of bundle: copy_from_unless_file_exists
verbose: P: Base context class: any
verbose: P: Container path :
'/default/copy_from_unless_file_exists/files/'/var/cfengine/inputs/
promises.cf'[0]'
verbose: P:
verbose: P: Comment: We only need to copy the file down if it does
not already exist.
verbose: P: .........................................................
verbose:
debug: Direct file reference '/var/cfengine/inputs/
promises.cf', no
search implied
verbose: File '/var/cfengine/inputs/
promises.cf' copy_from
'/var/cfengine/masterfiles/
promises.cf'
verbose: FindIdle: no existing connection to '192.168.33.2' is established.
verbose: Connecting to host 192.168.33.2, port 5308 as address 192.168.33.2
verbose: Waiting to connect...
verbose: Setting socket timeout to 30 seconds.
verbose: Connected to host 192.168.33.2 address 192.168.33.2 port 5308
debug: TLSVerifyCallback: no ssl->peer_cert
debug: TLSVerifyCallback: no conn_info->key
debug: This must be the initial TLS handshake, accepting
verbose: TLS version negotiated: TLSv1.2; Cipher:
AES256-GCM-SHA384,TLSv1/SSLv3
verbose: TLS session established, checking trust...
verbose: Received public key compares equal to the one we have stored
verbose: Server is TRUSTED, received key
'SHA=30017fd4f85914d0fa2d8c733958b5508d8383363d937e6385a41629e06ca1ca'
MATCHES stored one.
debug: TLSRecvLines(): CFE_v2 cf-serverd 3.7.3.
debug: TLSRecvLines(): OK WELCOME USERNAME=root.
debug: SendTransaction header: t 59
debug: SendTransaction data: SYNCH 1469473897 STAT
/var/cfengine/masterfiles/
promises.cf
debug: ReceiveTransaction header: t 71....
debug: ReceiveTransaction data: OK: 0 384 0 0 0 11257 1469390462
1469390461 1469390462 0 661354 1 64768
debug: ReceiveTransaction header: t 3.....
debug: ReceiveTransaction data: OK:
debug: Trying to create a parent directory for:
/var/cfengine/inputs/
promises.cf
debug: Directory for '/var/cfengine/inputs/
promises.cf' exists. Okay
verbose: Destination file '/var/cfengine/inputs/
promises.cf' already exists
verbose: Existence only is promised, no copying required
debug: Searching for specific busy connection to: 192.168.33.2
debug: Busy connection just became free
verbose: Handling file existence constraints on
'/var/cfengine/inputs/
promises.cf'
verbose: A: Promise was KEPT
verbose: P: END files promise (/var/cfengine/inputs/promises....)
```