Code Monkey home page Code Monkey logo

Comments (13)

shettyg avatar shettyg commented on August 23, 2024

@AakashKT

As asked in the instructions, did you run:

ovs-vsctl set Open_vSwitch . external_ids:ovn-remote="tcp:$CENTRAL_IP:6642" \
  external_ids:ovn-nb="tcp:$CENTRAL_IP:6641" \
  external_ids:ovn-encap-ip=$LOCAL_IP \
  external_ids:ovn-encap-type="$ENCAP_TYPE"

If so, what does the following command give you:

ovs-vsctl get open_vswitch . external-ids:ovn-nb 

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

@shettyg
Thanks for the reply
Yes, I have run the command you mentioned.
For this command :
ovs-vsctl get open_vswitch . external-ids:ovn-nb
the output is :
"tcp:35.185.55.145:6641"

from ovn-kubernetes.

shettyg avatar shettyg commented on August 23, 2024

What is the platform? i.e Ubuntu 14.04 etc.
What is the Python version? I suppose this not a problem with "sudo"?

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

Platform is Ubuntu 16.04
I have not installed anything over the system python (i.e. 2.7)
I am running the above command with "sudo", since if I don't, it gives Permission Denied error. Could that be the issue?

from ovn-kubernetes.

shettyg avatar shettyg commented on August 23, 2024

Looks like python3 is being invoked instead of python2.7

Put this code in a file and run it in both python2.7 and python3 and run it with sudo
e.g: sudo python3 1.py
sudo python2.7 1.py

import subprocess

def call_popen(cmd):
    child = subprocess.Popen(cmd, stdout=subprocess.PIPE)
    output = child.communicate()
    if child.returncode:
        raise RuntimeError("Fatal error executing %s" % (cmd))
    if len(output) == 0 or output[0] is None:
        output = ""
    else:
        output = output[0].strip()
    return output


def call_prog(prog, args_list):
    cmd = [prog, "--timeout=5", "-vconsole:off"] + args_list
    return call_popen(cmd)


def ovs_vsctl(*args):
    return call_prog("ovs-vsctl", list(args))

def fetch_ovn_nb():
    OVN_NB = ovs_vsctl("--if-exists", "get", "Open_vSwitch", ".",
                       "external_ids:ovn-nb").strip('"')
    print(OVN_NB)

fetch_ovn_nb()

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

@shettyg
I executed the above with both python2.7 and python3 with sudo as you asked.
You were right, python3 is being invoked, and its giving errors when I run the above code with python3. With python2.7 instead, its prints out the ovn-nb info.
What should I do to fix this? Also, a bit confused as to how python3 is being invoked

from ovn-kubernetes.

shettyg avatar shettyg commented on August 23, 2024

What does the following say?

/usr/bin/python --version

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

output :
Python 2.7.12

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

@shettyg
So i noticed something off, in the original code, the scripts such as ovn-k8s-overlay have shebang line
#!/usr/bin/python
but after installing (i.e after running pip install . ), the file /usr/bin/ovn-k8s-overlay has
#!/usr/bin/python3
Don't know why that is happening though

from ovn-kubernetes.

shettyg avatar shettyg commented on August 23, 2024

@AakashKT
Thanks for tracking it down. Does 'pip2 install .' solve the problem? (After doing a pip uinstall ovn-kubernetes)

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

@shettyg
Thanks for the help, that did solve the problem. I guess this was not an issue after all?
Again, thank you :-)

from ovn-kubernetes.

shettyg avatar shettyg commented on August 23, 2024

I will spend some time to get it to work for python3 too.

from ovn-kubernetes.

AakashKT avatar AakashKT commented on August 23, 2024

Oh okay, that would be great.

from ovn-kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.