ralph icon indicating copy to clipboard operation
ralph copied to clipboard

IP Export & Import

Open Talangor opened this issue 6 years ago • 4 comments

hi it's me again after patch by @szymi- i can export ip addresses but when i try to import same exported data i get error

Line number: 1 - Column 'asset': not enough values to unpack (expected 2, got 1) OrderedDict([('asset', '1293'), ('asset_str', 'VirtualServer: test1 (IT-Infra - test1)'), ('network', '39'), ('network_str', 'MT-SR-none-VLAN (0.0.0.0/0 | VLAN: None)'), ('id', '14'), ('created', '2019-05-29 09:17:38'), ('modified', '2019-05-29 09:17:38'), ('last_seen', '2019-05-29 09:17:38'), ('ethernet', '8'), ('ethernet_str', 'None (xx:xx:xx:xx:xx)'), ('address', 'x.x.x.x'), ('hostname', ''), ('number', '170873905'), ('is_management', '0'), ('is_public', '0'), ('is_gateway', '0'), ('status', '1'), ('dhcp_expose', '0')]) Traceback (most recent call last): File "/opt/ralph/ralph-core/lib/python3.6/site-packages/import_export/fields.py", line 64, in clean value = self.widget.clean(value) File "/opt/ralph/ralph-core/lib/python3.6/site-packages/ralph/data_importer/widgets.py", line 176, in clean asset_type, asset_id = value.split("|") # dc/bo, pk ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/ralph/ralph-core/lib/python3.6/site-packages/import_export/resources.py", line 374, in import_data self.import_obj(instance, row, real_dry_run) File "/opt/ralph/ralph-core/lib/python3.6/site-packages/import_export/resources.py", line 238, in import_obj self.import_field(field, obj, data) ValueError: Column 'asset': not enough values to unpack (expected 2, got 1)

Originally posted by @Talangor in https://github.com/allegro/ralph/issues/3449#issuecomment-497911290

Talangor avatar Jun 01 '19 04:06 Talangor

nothing ?

Talangor avatar Jun 10 '19 04:06 Talangor

some days ago, i test to export ip address ,but i faild that it comes up 500 error. today i find out that the IPAddress module in ralph web(https://ralph-demo.allegro.tech/) has changed. And even adding a ip address will cause 500 error.

SuperChaw avatar Jun 23 '19 03:06 SuperChaw

@SuperChaw hey buddy I did something about this but it does not relate to the code itself I exported and created queries from MySQL database itself and I really really regret choosing Ralph and working on it maybe I'm wrong but i think it's designed so no one can migrate from Ralph you will see what I mean when you go and investigate SQL tables everything is referenced to other tables with id's

Talangor avatar Jun 24 '19 14:06 Talangor

you will see what I mean when you go and investigate SQL tables everything is referenced to other tables with id's

late reply, but that's the way Django is working with databases, this relations are defined as model classes and database independent (more or less). So all the relationship are in the model and you can export that

schka17 avatar Apr 30 '20 13:04 schka17