Skip to content
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

Propagation of options is broken #47

Closed
danbeaulieu opened this issue Jun 26, 2014 · 8 comments
Closed

Propagation of options is broken #47

danbeaulieu opened this issue Jun 26, 2014 · 8 comments
Labels

Comments

@danbeaulieu
Copy link

Hi, is there any further documentation explaining how to set ScpOptions without created a separate engine? I have tried various permutations on (I am new to Groovy, but I did do a bit of research):

remoteSession {
  host = args[0]
  username = args[1]


  scpOptions({
    showProgress = false
    verbose = false
  })
  scp "/tmp/foo.zip", '/tmp'
}

however I am still seeing the progress, and when foo.zip is large it is extremely verbose.

Also, the docs say showProgress default is false, which I believe is wrong.

@aadamovich
Copy link
Member

Can you show your full script, please?

@aadamovich
Copy link
Member

You are right about the default value. It is actually true by default. I will fix the docs.

@aadamovich
Copy link
Member

What if you move scpOptions outside remoteSession? Also you may set global verbosity level to false:

verbose = false
scpOptions {
   showProgress = false
   verbose = false
}

remoteSession {
   host = args[0]
   username = args[1]
   scp "/tmp/foo.zip", '/tmp'
}

There is logging improvement that will be included into next version of sshoogr. That should be much better than current progress logging which is rather simplistic. Stay tuned.

@danbeaulieu
Copy link
Author

That is pretty much the full script minus the Grab and import

@Grab('com.aestasit.infrastructure.sshoogr:sshoogr:0.9.16')

import static com.aestasit.ssh.DefaultSsh.*
import com.aestasit.ssh.ScpOptions
import com.aestasit.ssh.SshOptions
import com.aestasit.ssh.dsl.SshDslEngine

println "Deploying to " + args[0]

remoteSession {
  host = args[0]
  username = args[1]


  scpOptions({
    showProgress = false
    verbose = false
  })
  scp "/tmp/foo.zip", '/tmp'
}

but like I said, this is just one version. I've tried nearly every permutation I can come up with but I am having a hard time figuring out how to turn off progress at all.

@danbeaulieu
Copy link
Author

just saw your update, if I try it outside of the remoteSession, and remove it from the inside I get a similar error:

Caught: groovy.lang.MissingMethodException: No signature of method: com.aestasit.ssh.ScpOptions.call() is applicable for argument types: (deploy$_run_closure1) values: [deploy$_run_closure1@4c2fa904]
Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), find()
groovy.lang.MissingMethodException: No signature of method: com.aestasit.ssh.ScpOptions.call() is applicable for argument types: (deploy$_run_closure1) values: [deploy$_run_closure1@4c2fa904]
Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), find()
    at deploy.run(deploy.groovy:13)

@aadamovich
Copy link
Member

This one works for me:

@Grab('com.aestasit.infrastructure.sshoogr:sshoogr:0.9.16')

import static com.aestasit.ssh.DefaultSsh.*

println "Deploying to " + args[0]

verbose = false

remoteSession {
  host     = args[0]
  username = args[1]
  password = args[2]
  scp {
    showProgress = false
    from { localFile "foo.zip" }
    into { remoteDir '/tmp' }
  }
}

As I already mentioned, logging will be cleaned up in next version.

@kshtsk
Copy link

kshtsk commented Jul 5, 2014

Hi guys, this is really a bug, 'showProgress' as well as other scpOptions became not working since 0.9.11, it was functional in 0.9.4

@aadamovich
Copy link
Member

Wow, it's nice to know someone is using sshoogr since 0.9.4 :). Yes, I confirm there is a problem with option overriding mechanism in current version. I hope to fix it upon next release in 0.9.17, which is going to come this month.

@aadamovich aadamovich added the bug label Jul 6, 2014
@aadamovich aadamovich changed the title Documentation for setting ScpOptions Propagation of options is broken Jul 6, 2014
aadamovich added a commit that referenced this issue Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants