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

Tweaks for ubuntu precise #49

Merged
merged 2 commits into from
Aug 24, 2012
Merged

Conversation

hmalphettes
Copy link
Contributor

Thanks Michal for looking after the shebang.

I am getting further errors when running on ubuntu-12.04 (aka precise)
The reason is that the file command does not return the same text on ubuntu-10.10 (aka lucid)

Here is the file:

root@lucid64:/vagrant# ll /opt/sm/exts/active/bosh-solo/bin/status
-rwxr-xr-x 1 root root 498 2012-08-22 02:27 /opt/sm/exts/active/bosh-solo/bin/status*
root@lucid64:/vagrant# cat /opt/sm/exts/active/bosh-solo/bin/status | head -1
#!/usr/bin/env ruby

On lucid64, the file command returns:

root@lucid64:/vagrant# file /opt/sm/exts/active/bosh-solo/bin/status
/opt/sm/exts/active/bosh-solo/bin/status: a ruby script text executable

On precise64:

root@precise64:/vagrant# file /opt/sm/exts/active/bosh-solo/bin/status
/opt/sm/exts/active/bosh-solo/bin/status: a ruby script, ASCII text executable

As a consequence; on lucid64, bosh-solo status's action_type is "binary"
where as on precise64, it is "ruby".
This explains the difference of treatment and why on lucid64 we did not see the shebang issue reported in pull 48.

The next problem is this block of code around line 188 https://github.com/sm/sm/blob/master/core/internal/shell/extensions/execution/functions#L188:

(ruby)
 ... for script in functions initialize
 do
    requires+=( "-r${__sm_modules_path}/ruby/core/${script}.rb" )
 done

It is not executed on lucid64; on precise64, it is executed and looks for the files:
/opt/sm/core/sm/shell/ruby/core/functions.rb
/opt/sm/core/sm/shell/ruby/core/initialize.rb

Both of which do not exist.
For now I have added a guard to check if they exist and silently skip them if they don't.

After that sm bosh-solo status works fine on precise.

Thanks again for your attention!

On ubuntu-precise when running a ruby extension the console shows:
    root@precise64:~# sm bosh-solo status
    __sm.extension.actions.type:43: scalar parameter binary created globally in
    function
@travisbot
Copy link

This pull request passes (merged 1976910 into 89ab1ab).

This is a guard to not add to the list files that don't exist.
When sm is installed for the root user, those files are

    /opt/sm/core/sm/shell/ruby/core/functions.rb
    /opt/sm/core/sm/shell/ruby/core/initialize.rb

They look like core sm files: this fix is not the definitive one.
Are these files located elsewhere?
Should this block of code be entirely removed?
@travisbot
Copy link

This pull request passes (merged 0d308ec into 89ab1ab).

mpapis added a commit that referenced this pull request Aug 24, 2012
@mpapis mpapis merged commit 2b8929c into sm:master Aug 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants